OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for ...

learn more… | top users | synonyms

1
vote
1answer
22 views

What are the units when reading depth using glReadPixels()?

Suppose I use glReadPixels() to read the depth of a pixel from the depth buffer. What are the units of this? Is it the distance from the camera? Or the distance from the near clip plane? And is the ...
0
votes
0answers
22 views

Fixing memory leak in Opengl texture class [on hold]

I recently run my 3D game engine under Valgrin and discovered that everything's almost fine, except that I leak 7,862 bytes in my opengl texture class... I think that I'm not calling a specific opengl ...
0
votes
0answers
15 views

Perspective divide: Why use the w component? [duplicate]

In OpenGL, I have read that a vertex should be represented by (x,y,z,w), where w = z. This is to enable perspective divide, whereby (x,y,z) are divided by w in order to determine their screen position ...
0
votes
1answer
8 views

Passing data into a vertex shader for perspective divide

In OpenGL and GLSL, I am just learning about perspective projection and the vertex shader. However, I am a little confused about what data actually needs to be passed to the vertex shader, and what ...
0
votes
0answers
15 views

GLFW - Event Polling System

I need some help on design. I'm making an event polling system, where a window is notified of events as they happen. I handle events at a system level in my GLFW backend, by using callbacks. ...
0
votes
1answer
27 views

OpenGL Core profile - Array of arrays in glBufferData for VBOs

I want to send each face as VBO, and I structured the data as this facevbo[0] = x x x x x x //x,y,z,r,g,b,s,t facevbo[1] = x x x x x facevbo[2] = x x x x x x x facevbo[3] = x x x x . . . ...
0
votes
2answers
23 views

Render specific part of a texture in OpenGL (2D Sprite Sheet)

I've looked at this answer to find out how to render just a part of a texture: http://stackoverflow.com/questions/6884285/c-opengl-render-part-of-an-image I tried that, but the problem is, this is how ...
-1
votes
0answers
30 views

Raytracing in OpenGL

I've been looking through some raytracing information recently and I have a question. I think the only way to do raytracing in OpenGL is to use the compute shader, right ? But does it have the luck of ...
0
votes
0answers
29 views

Image speeds up while moving and or rotating instead of constant speed

I'm having a problem with rotating/moving an image. I've set one of my images to rotate on it's z-axis buy updating the angle, but when I run my game, the image starts slowly starts to rotate from a ...
0
votes
0answers
13 views

OpenGL, glDrawElementsInstanced behaving differently on NVIDIA GPU than AMD

I have an AMD GPU on my desktop, AMD HD 5770. I am working on a project on my desktop for over a year. In the scene, I have instanced grass and instanced trees. Everything is working fine on desktop, ...
0
votes
1answer
23 views

glGenArrays - This functionality is not available

Whenever I call glGenVertexArrays(), I get the following exception: Exception in thread "main" java.lang.IllegalStateException: This functionality is not available. at ...
0
votes
0answers
31 views

Open GL 3.3 quad not drawing

Right Now I'm just trying to draw a quad(Latter will draw a texture on it) but for some reason its not showing up. My clear color is working so openGL is working. I don't want to focus on any shaders ...
0
votes
0answers
27 views

Modern OpenGL Sprite Drawing - Not Rendering

I'm trying to render sprites based of this tutorial, in LWJGL. Here's what I have so far, with descriptions of what class I use: Transformable2D is a class that holds transform matrices meant for ...
0
votes
0answers
13 views

OpenGL 3.3 is not clearing color

When I open the window its show nothing with a white background. I tried earlier to draw a triangle and nothing shoed up. I belive for some reason OpenGL is just not displaying. Maybe I need to ...
0
votes
0answers
19 views

OpenGL, Multithreaded loading/streaming of data

I've thought about how i could implement loading of data in a second thread for two reasons, first, so i can show a nice loading-screen with progressbar and second, for openworld streaming. I came up ...
2
votes
1answer
30 views

OpenGL ES God Ray Precision error

I have encountered the following (i think) precision error. (missing link need 10 rep) My source of inspiration was: (missing link need 10 rep) On the PC everything works fine, but on android it ...
2
votes
0answers
47 views

OpenGL picking performance: ray casting vs. color picking

I am curious of how the performance of color picking compares to ray casting. I am looking at the scenario when the mouse is clicked which means only then the scene is rendered in a backbuffer for ...
0
votes
1answer
62 views

What's better - drawing every interval that the window updates, or drawing when necessary and updating when drawing?

So what's better? In case the title is a bit confusing I mean: 1) Drawing every window update interval. For example, for a 60FPS window, every 17 milliseconds. For example: ...
1
vote
2answers
73 views

Smallest, most memory-efficient way to have tiles? (C++/OpenGL)

I need to have tiles in my game, just 16x16 images, there would be hundreds (or even thousands) that make up a level. Of course it's not viable to have thousands of memory-hog normal entities, but ...
0
votes
0answers
41 views

Object Rotation with mouse around his axis using Quaternions

I faced a couple of days ago a gimball lock problem , trying to rotate an object on openGL 2.1. I have done some researches and found out that Quaternions could help me. So I implemented the class ...
-1
votes
2answers
66 views

Cant decide on openGL 2 or 3 for 2D game engine [closed]

Hi I want to make a 2D game engine. I want to make this engine to learn lower level code. I cant decide If I want to use OpenGL 3.x or 2. The engine should support Linux, MacOSX, Linux, Android and ...
0
votes
1answer
41 views

How to use traditional pixel coordinates system in OpenGL? (with C++/SDL2)

I find the normalized, centralized coordinate system used in OpenGL weird and annoying, is there anything I can do at all to make it work like normal pixel coordinates on everything ever except ...
1
vote
4answers
52 views

OpenGL calls from a different thread?

I understand OpenGL is not thread-safe, but at the same time, Google seems to be giving me mixed responses. I have a LibGDX game that functions normally, UI/rendering/logic on the same thread, ...
1
vote
1answer
30 views

OpenGL 4.5 Primitive Restart vs. Base Index

From how I understand the two techniques (Primitive Restart and Base Index) explained on https://www.opengl.org/wiki/Vertex_Rendering , they both do the very same thing. Simply spoken, they allow me ...
2
votes
0answers
81 views

OpenGL 2.1 rotation , Gimball lock

I'm working on a little app for a school project , which should be manipulating 3D objects. And i'm stuck with the rotation , as i'm facing what i think is called the gimball lock ? here's a video I ...
-1
votes
0answers
27 views

Help with Zoom in Functionality in Mandelbrot set

I was able to create Mandelbrot set. Now, I want to zoom in and out and can use left right key to navigate. Here is my code. #include <windows.h> #include <iostream> #include ...
-1
votes
0answers
44 views

Is it worth it to learn directx? [closed]

for the last few months ive been learning opengl(in python, java and c++), I know that directx is windows exclusive and (unless you count bindings) is exclusive to c++, but other than that what are ...
0
votes
2answers
61 views

How do I start and stop a GLSL shader?

Is there a way to start and stop a shader?. I want to use this shader to sweep once over my texture and then stop. Does anybody know how to do that? void mainImage( out vec4 fragColor, in vec2 ...
0
votes
1answer
21 views

sfml/opengl, two objects of same class are sharing variables

whenever I use the none-default constructor, it only adds to the coordinates of the previous class(in an array) wall_1x1 wall[2] = { wall_1x1(0, -2, 0), //first argument is x, second z, and ...
1
vote
1answer
43 views

Instanced rendering with ARB_vertex_attrib_binding

I'm trying to separate the vertex format specification from the vertex data. I was able to do that for the mesh vertices successfully. For instanced rendering I wanted to further separate the instance ...
0
votes
1answer
33 views

Opengl, VAO creation within a class

Creating the VAO for a simple cube within a function in the main file results in the cube being rendered properly: GLuint createCube() { GLuint VBO; GLuint VAO; GLuint EAO; GLfloat ...
1
vote
1answer
39 views

Android OpenGL EGL context lost

I'm developing simple Android game in OpenGL ES 2.0 and the development stage is getting closer to publishing game on play store, but I'm still unsure about EGL context behaviour on different devices. ...
1
vote
0answers
70 views

Creating lightning effect with glow effect

I am trying to recreate Drilian's lightning bolt in unity and I have faced a problem in the "Adding Some Glow" part. I am missing glow effect (and/ or "rounded beams"). Here is what I am doing: I ...
0
votes
0answers
11 views

OpenGL HUD is flickering when rotating the camera

I draw game HUD after drawing 3D scene. When I move the camera quickly, HUD starts flickering. I noticed that it happens only if the distance between the camera and an object its looking at changes ...
0
votes
1answer
22 views

How to move the generated polygon horizontally in openGL?

I am trying to develop a small ball game in OpenGL where rectangular bars of random height is generated and moved towards left and there is a ball which should be moved up and down(like jump action) ...
0
votes
1answer
43 views

Wrapping things up in opengl based library [closed]

I am currently building a render library, based on opengl : problem is that I'm starting to get a lot of different ccomponents (Shaders, Materials, Textures, Meshes, ...), and I'm trying to wrap ...
4
votes
2answers
135 views

How do I separate physics from framerate?

Skyrim (Creation Engine / Gamebryo) is a prime example of a game that has its physics tied to the framerate for which it has been heavily criticized, because if you disable vsync / have a > 60 HZ ...
0
votes
0answers
16 views

When use LookAt or Inverted world matrix to compute View Matrix?

I am reading this article http://www.3dgep.com/understanding-the-view-matrix/ and it says that View Matrix is the inverted matrix of World (or Model) Matrix but in the first approach the article ...
0
votes
0answers
33 views

Tessellation won't render

I am starting to work with tessellation and have some problems right in the beginning. I try to render a quad made of two triangles with tessellation, but nothing appears on the screen. But as soon as ...
0
votes
1answer
39 views

Rendering a texture with OpenGL

I have an image (100x200 px) painted with Paint.NET and saved as a .png with 32-bits color depth. How can i render this image using OpenGL 1.1 (with the LWJGL binding) or higher inside the display? I ...
0
votes
0answers
33 views

Model / Mesh Constructing OBB

Recently I started to implement simple bounding volumes in my Engine. So far I have implemented a Sphere and AABB, also I implemented simple ray-intersection methods for those two volumes. But I am ...
-2
votes
1answer
58 views

Porting SDL OpenGL Game to Android and IOS

I am currently learning OpenGL (3.0+) with C++. I am using SDL for input handling, window creation, etc., GLEW to use OpenGL and call OpenGL Functions, and GLM for OpenGL Math stuff. If I fully ...
0
votes
0answers
27 views

ETC1 texture opacity

I'm using the cocos2d-x engine and want to support etc1 on android devices for my game. For ETC1 i'm using the mali compression tool, and GLSL. Everything is working, but I can't change the opacity ...
0
votes
0answers
16 views

OpenGL textureGather and DirectX gather

These functions sample multiple RGBA pixels but return only a single component. OpenGL: https://www.opengl.org/sdk/docs/man/html/textureGather.xhtml DirectX: ...
0
votes
0answers
13 views

Wrong value from uniform block on OSX+OpenGL

I have a uniform block defined as follows: layout (std140) uniform u_LayerUniform { LayerStruct Layers[150]; }; and the LayerStruct is defined as follows: struct LayerStruct { vec4 ...
0
votes
0answers
36 views

Texture artifacts depending on texture size

I get some strange artifacting with textures depending on their size. I run OpenGL 3.3 with an GTX 580 so it should definitely support non power of two textures. I've narrowed down the problem ...
0
votes
1answer
82 views

How should I render multiple objects in OpenGL?

I am just getting my head wrapped around modern OpenGL. Let's say that I would like to draw 10 objects, how would I structure that? Would I call glDrawElements(...) in a for loop 10 times? void ...
0
votes
1answer
61 views

Opengl Best VAO model for voxel engine

I make a voxel engine on LWJGL 3 (OpenGL binding for JVM). I store all object data in world class. World is subdivided into 32*32*32 chunks. Chunks use octree storage. The main part of all my ...
0
votes
2answers
127 views

How does Minecraft render chunks? [duplicate]

I'm writing a simple Minecraft like game to test out a few world gen algorithms and to learn more about OpenGL. My first render code was glBegin() ... glEnd() style. Very ineficient and slow. I ...
0
votes
1answer
65 views

Achieving Retro Resolution with HD

I couldn't really find any tips on this (or perhaps I just lack the proper words once again), but I'm thinking about how to get some retro looks (SNES 16 Bit, specifially) using a modern system. ...