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

2
votes
1answer
723 views

How to make OpenGL rendering resolution independent from its window context resolution?

Can the rendering resolution of OpenGL and the window size (at least for the Windows OS) be separated? For example, I may only want to render at 400x300 resolution, but I want my window size to be ...
2
votes
1answer
1k views

SSAO looks wrong

I'm trying to implement SSAO based on this tutorial. My setup: OpenGL 3.2 Forward renderer View-space depth and normal in a single 16-bit floating point texture. The result I get is this: The ...
2
votes
1answer
512 views

How do I draw an animated object in OpenGL ES?

I have a VBO, which I initialise like this (just an example): - (void)setupVBOs { GLuint vertexBuffer; glGenBuffers(1, &vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); ...
2
votes
3answers
829 views

Order of render with transparency opengl

I tried to render using different render configurations (GL_BLEND_FUNC()) but I couldn't get the back object to render in certain angles. The first screenshot here shows one angle where the back ...
2
votes
2answers
3k views

In GLSL is it possible to offset vertices based on height map colour?

I am attempting to generate some terrain based upon a heightmap. I have generated a 32 x 32 grid and a corresponding height map -> In my vertex shader I am trying to offset the position of the Y ...
2
votes
2answers
2k views

std::map for storing static const Objects

I am making a game similar to Minecraft, and I am trying to fine a way to keep a map of Block objects sorted by their id. This is almost identical to the way that Minecraft does it, in that they ...
2
votes
1answer
181 views

Can Entities Have Their Own Shader In Deferred Rendering?

Since you need to use the general g-buffer shader to fill g-buffer, how can entities have their own shaders, like giving a box normal mapping feature ? As I remember, you can't use two shaders at the ...
2
votes
1answer
182 views

Does interleaving in VBOs speed up performance when using VAOs

You usually get a speed up when you use interleaved VBOs instead of using multiple VBOs. Is this also valid when using VAOs? Because it's much more convenient to have a VBO for the positions, and one ...
2
votes
1answer
194 views

GL_TRIANGLE_ADJACENCY and glDrawElements

So I've not been able to find much online about how data should be stored for triangle adjacency. Currently I calculate my adjacent using half-edges (mention in an answer here). But do I store this ...
2
votes
1answer
72 views

What measurement units are used in the return value of the getWidth method in the UnicodeFont class supplied by Slick2D?

I'm working on a small component for a game that essentially wraps the provided String so that it fits within the width of the provided rectangle. The rectangle is provided by the Slick2D library as ...
2
votes
1answer
1k views

How to tell what part of a 3D cube was touched

I am writing a rather simple android game and I am implementing Open GL to draw a 3D cube that spins upon the X, Y and Z axis and I need to know where the user has clicked on the texture of the cube. ...
2
votes
1answer
1k views

does glBindAttribLocation silently ignore names not found in a shader?

Does glBindAttribLocation silently ignore names that are not found? For example, in a shader: // Some vertex shader in vec3 position; in vec3 normal; // ... And in some set up code: // While ...
2
votes
1answer
1k views

Simple Optimized Blur Shader

I have a vertex-fragment shader that use the Unity3D GrabPass functionality (it grabs the screen). And I apply my GrabPass to have a transparent effect. GrabPass { "_GrabTex" } sampler2D ...
2
votes
1answer
745 views

RGB to xyY color space conversion and luminance

The luminance calculated by following GLSL functions (fragment shaders - tonemap) has different value: float GetLuminance (vec3 rgb) { return (0.2126 * rgb.x) + (0.7152 * rgb.y) + (0.0722 * rgb....
2
votes
1answer
648 views

How to solve artifacts caused by vertex lighting in my voxel engine?

My current lighting system bakes the light amount based on ray-tracing from the light source to the 8 corners of the block (so per-vertex) and the distance to the light on the blocks. It works ...
2
votes
2answers
988 views

Does my 2D OpenGL renderer need optimized?

I've started a game engine for learning purposes. I have successfully gotten an opengl renderer working and I can draw textures of varying sizes to the screen. The way I have done this is by creating ...
2
votes
1answer
717 views

mixing forward and deferred rendering

Simplified version of my deferred rendering looks like this: bind fbo1 clear color and depth buffers gbuffer stage (gbuffer contains only these pixels which pass a depth test) unbind fbo1 bind fbo2 ...
2
votes
1answer
100 views

Precomputing SSAO causes driver timeout

I was trying to do a pre-calculations of an SSAO effect by rendering normals and depth on a cubemap and doing a second ssao pass on each of these faces. The problem is I'm getting a timeout: "the ...
2
votes
1answer
386 views

VBO and shaders confusion, what's their connection?

Considering OpenGL 2.1 VBOs and 1.20 GLSL shaders: When creating an entity like "Zombie", is it good to initialize just the VBO buffer with the data once and do N glDrawArrays() calls per each N ...
2
votes
1answer
181 views

Shadow cubemapping?

I am working on a game with C++ and OpenGL 3.2. I have successfully implemented directional shadow maps and now I'd like to upgrade them to shadow cube maps (for point lights). I've done some Googling ...
2
votes
1answer
242 views

OpenGL and Java user interface architecture/comunication [closed]

I'm working on the UIs for a turn based tactical rpg made with Java and LWJGL. I'd like to make a set of "dynamic" UIs similar to those of the game Torchlight 2. I would like to know if there are any ...
2
votes
1answer
629 views

Bad FPS for smaller size (OpenGL ES with SDL)

If you saw my other question, well, there is still a little problem: Click here to watch on youtube Basically, the frame rate is very bad on the actual device, where for some reason the animation is ...
2
votes
2answers
159 views

setting the position in different resolution

I have a normal game window which is 640*480, and everything is fine, but when I try to maximize the window, the objects translate to different positions on the screen, for example If I have a circle ...
2
votes
1answer
2k views

Does Macbook Air 2012 (Intel HD4000) support GLSL 1.3+?

I'm using SDL2 and GLEW on OSX Mountain Lion (2012 Macbook Air) to create an OpenGL context. Querying for the GLSL version, it reports GLSL version 1.2. I'm curious if this is a limitation of the ...
2
votes
2answers
975 views

Rotating an object smoothly

I'm trying to rotate a ship in an asteroid game. What I'm doing is creating a float angle variable and at each time I press left or right buttons, I increase and decrease it, and in the drawing ...
2
votes
1answer
3k views

“Unable to create OpenGL 3.3 context (flags 0, profile 1)”

Trying to run any of the well-known McKesson's tutorials on a friend's laptop results in the aforementioned exception. I read that in order to run applications which use OpenGL 3.3 you must at least ...
2
votes
1answer
3k views

Zooming to point of interest

I have the following variables: Point of interest which is the position(x,y) in pixels of the place to focus. Screen width,height which are the dimensions of the window. Zoom level which sets the ...
2
votes
1answer
1k views

Tweening Colors in OpenGL

I'm making a sky gradient in OpenGL by drawing with glColorPointer and glDrawArrays. I would like to be able to change the sky colour from morning to daytime to evening etc. I can either: Make a ...
2
votes
2answers
833 views

Loading multi-texture 3ds c++

I have a question about loading 3ds using this tutorial. I want to use more than one texture on the model (because here all the models have more than one) but it seems that this library can't do that. ...
2
votes
1answer
811 views

Checking Collisions In 2D Platformer With Tiles

My team and I are developing a 2D platformer with C++/SDL/OpenGL, and we already defined a collision system, but we have a problem checking collisions with the tilemap. The tiles of the tilemap are ...
2
votes
1answer
10k views

Rotating an object in OpenGL about it's centre

Im writing a game for which, one of the models are loaded from an .obj file. It's a model of a plane, and I want to rotate the propeller. The object file is broken into groups, and the propeller is ...
2
votes
1answer
3k views

How to convert pixel coordinates to GL coordinates in 2D space?

I know that if you want to display a sprite on screen (in 2D) you can use glOrtho and essentially make 1 gl unit equal to 1 pixel, so when I plot out the vertices for say a 128x128 image (on a quad), ...
2
votes
2answers
179 views

What is the purpose of glEdgeFlagv?

I know that what both glEdgeFlagv and glEdgeFlag do is toggle boundary edge status, but my question is why does the v version exist when the documentation specifies that the only difference is that ...
2
votes
3answers
1k views

Mapping rectangular texture on trapezoid-like shape

I have a problem with rendering rectangular textures on non-rectangular surfaces. While googling, I found a thread with person having a pretty similar problem: http://www.gamedev.net/topic/419296-...
2
votes
2answers
4k views

Using index arrays with OpenGL VBOs

I've recently started reading about VBOs. If, for example, I want to draw a cube using VBOs, can I use one VBO to hold the coordinates for the 8 vertices, and another one as an index array, to ...
2
votes
1answer
1k views

Looking for a GUI library for OpenGL, or tips for my own (MetroUI)

I am making an OpenGL graphics accelerated FPS, and I need to find a library to handle GUI correctly. My current GUI handler just wont do! Yes, as in the title says, the UI of the game is Metro (...
2
votes
1answer
719 views

Beginner question about vertex arrays in OpenGL

Is there a special order in which vertices are entered into a vertex array? Currently I'm drawing single textures like this: glBindTexture(GL_TEXTURE_2D, texName); glVertexPointer(2, GL_FLOAT, 0, ...
2
votes
2answers
6k views

Is there any opengl cel shading tutorial out there (without GLAUX)?

I want to implement cel shading into my opengl game. I have only found a nehe tutorial that uses glaux (old as hell). I'm looking into it, but I wanna avoid the pain of learning how to translate those ...
2
votes
2answers
2k views

3D game special effects, fire, lightning, water, and ice

I'm working on a 3d game using OpenGL and would like to take it in a fantasy direction. Specifically I'm thinking of having magic with effects for fire, water, ice, and lightning. My problem is I ...
2
votes
1answer
28 views

glUniformMatrix4fv OpenTK equivalent

Very simple and quick question which surprisingly I couldn't find an answer to over the internet: what is the equivalent of glUniformMatrixfv for opentk? I've browsed all the 7 overloads of GL....
2
votes
1answer
65 views

Is there any way in open-gl to “bit crush” everything on the screen?

I am making an educational game and am looking for options for a visual effect to show when something is "incorrect". So, I am looking to see if there's an easy way in openGL to temporarily distort ...
2
votes
1answer
56 views

Polygon edges visible when using per-fragment lighting (OpenGL)

I have created a mesh in Blender (just a sphere with a texture over it; it's supposed to look like mars) and I've exported it as OBJ. I've tried it both with exporting with normals in Blender's export ...
2
votes
1answer
140 views

Finding pitch/yaw values from lookat vector

I have a camera class that contains a position, a pitch, and a yaw (the pitch and the yaw correspond to y and x rotation values). I want to implement a lookAt function that takes a vector and the ...
2
votes
2answers
282 views

MSAA/ CSAA / FXAA How to set the mode in OpenGL?

I'm learning OpenGL and something I am stuck with is AA. Specially when I want to turn it on and off at runtime. I know that I can set the samplecount when I create a FBO and blit it over to the final ...
2
votes
1answer
388 views

GL_DEPTH_COMPONENT vs GL_DEPTH_COMPONENT32

I googled like crazy and checked the OpenGL documentations but I couldn't find out how the precision of a depth buffer created using GL_DEPTH_COMPONENT is chosen. As far as I know the precision is ...
2
votes
1answer
129 views

OpenGL not rendering textures

i'm using OpenGL 2.1 with SDL2.0 and i'm trying to render a texture, using this steps: load the image: Image* image = new Image(); image->image = SDL_LoadBMP(path.c_str()); if (!image->...
2
votes
1answer
135 views

Render scene depth to texture via FBO?

I'm trying to render my scene's depth via FBO and Render To Texture. I have a scene that I'm rendering to a texture, then render that texture to a fullscreen quad in a second pass using a fragment ...
2
votes
1answer
87 views

OpenGL vertex data per index

Usually, vertex data is assigned to a particular vertex, like this: [data] [vertices] [1.31] -> [1, 13, 5] [84.3] -> [5, 8, 12] [.095] -> [8, 3, 10] Then, you would typically have an ...
2
votes
1answer
376 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 ...
2
votes
1answer
1k views

OpenGL VBO and VAO Confusion

I would like to present here my Question about VBOs and VAOs. Basically from what i understand you can have different VAOs each of which can contain up to several VBOs , and by binding to the VAO's ID ...