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
519 views

Translate the ModelView matrix, or change vertex coordinates?

If I have a simple 2D scene and I want to move the objects inside the scene on the X and Y axis, should I send OpenGL the original vertex coordinates with each move and apply a ModelView matrix ...
1
vote
1answer
691 views

Multiple buffering in OpenGL on Windows

What is the most common way modern games perform triple buffering ? What does the SwapBuffers exactly do in terms of OpenGL states ? Is it possible to perform double and triple buffering ...
1
vote
1answer
375 views

OpenGL: Rotating cannon about non-centre position?

So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is: glPushMatrix() glTranslatef(self.position.x,2.5,self.position.z) ...
1
vote
1answer
791 views

Translating local to global coordinates in ARToolkit / OpenGL

Ok, so I've tried reading over the other questions and something's just not clicking for me. I am working on an augmented reality application using ARToolkit, however it should just be straight ...
1
vote
1answer
317 views

Positioning a texture inside a 3D object with GLSL

I have a 3D object in my scene and a texture that is the same size of the screen (a render to texture). Is there a way to make the object act like a "mask" for the texture(using glsl), so the texture ...
1
vote
1answer
236 views

Why am I getting a “multiple definition of *” error when initializing OpenGL extensions?

I'm creating a game engine using OpenGL, and I'm initializing the extensions manually, i.e. this: // .h file PFNGLACTIVETEXTUREPROC glActiveTexture; /* .cpp file, initialization function */ ...
1
vote
1answer
749 views

How can I fix these errors with Panda3D's sample projects?

I just installed the latest Panda3D packages on a Mint 12 32-bit virtual machine. Then I downloaded and configured Eclipse and tried to run the Asteroids sample project. The window is created ...
1
vote
1answer
508 views

A comparison of graphics libraries and their respective programming languages [closed]

A comparison of graphics libraries and their respective programming languages. A.K.A. "Which do I pick? With a twist." I'm a long time professional programmer who never gave up on programming as a ...
1
vote
1answer
300 views

How do I determine if a tile is a slope based on the tile image?

In my game, every tile is a 32x32 texture. All the slopes are a 0 - 45 degree angle. I would like to determine, at the time I load the tile, if the is sloped by examining its texture/bitmap data. How ...
1
vote
1answer
541 views

How can I place a ProgressBar in Android using Cocos 2d?

I want to place a horizontal progress bar in my Android application and I want to change its progress color. I used the following code, but the progress bar is not being displayed. CCProgressTimer ...
1
vote
1answer
247 views

Change flag if mousepress while on loop

I have this program that starts a loop when the key is pressed The problem is that when i start the loop, i want to be able to stop it halfway with my mousepress. The problem is that it doesn't ...
1
vote
1answer
711 views

GLSL woes involving texturing

I'm a beginner to OpenGL and GLSL especially, and I'm having a lot of trouble getting textures to display via shaders. My shader code compiles without any warnings or errors, but I seem completely ...
1
vote
2answers
851 views

LWJGL Determining whether or not a polygon is on-screen

Not sure whether this is an LWJGL or math question. I want to check whether a shape is on-screen, so that I don't have to render it if it isn't. First of all, is there any simple way to do this that I ...
1
vote
2answers
2k views

GLM: Quaternion SLERP Interpolation

I wish to interpolate two quaternion values. As I still can not get working results, can I kindly ask you to verify my function calls? The code below supports GLM (OpenGL Mathemathics) library, so ...
1
vote
1answer
1k views

OpenGL ES 2.0: Converting GL_TRIANGLES into GL_TRIANGLE_STRIP

I export my 3D geometry from a 3D authoring application. It is possible to export the vertex coordinates as full triangle arrays. On ther other hand, triangle strips are more efficient for the ...
1
vote
2answers
937 views

Having a slight problem moving my camera based on time passed using GLUT/OpenGL

Before anyone asks, this is for a university project and I have to use GLUT. I'm not tagging this as homework because this is not a requirement, nor will I have extra points for this. With GLUT, for ...
1
vote
2answers
396 views

opengl rotations for a human

I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder in ...
1
vote
1answer
1k views

Restoring projection matrix

I am learning to use FBOs and one of the things that I need to do when rendering something onto user defined FBO, I have to setup the projection, modelview and viewport for it. Once I am done ...
1
vote
1answer
1k views

How to use OpenGL blend mode/functions to brighten/darken a texture.

Tried this code, but the texture didnot get any lighter. try { texture = TextureLoader.getTexture("png", ...
1
vote
1answer
571 views

Broken alpha of two-sided OpenGL mesh

How do I get rid of this alpha transparency artifacting with classic fixed function OpenGL? I tried all kinds of settings but I'm not sure why it's good in the upper half of the mask but not in the ...
1
vote
1answer
157 views

Anti Aliasing: How to implement supersampling in OpenGL?

I'm learning OpenGL by working on a small Oculus Rift project, which implies, anti aliasing is everything :). Since the application of the barrel distortion shader requires rendering to a framebuffer ...
1
vote
1answer
106 views

GLSL - std140 uniform block - fields(vec, float, mat4) always 0.0

Ok, First of all, if just use uniforms everthing works like it should. Switching to uniform blocks nothing goes, as all values look like 0.0. I tested this with various if-then-else stuff within the ...
1
vote
1answer
69 views

GLSL associating multiple uniform samplerBuffers

At the moment I'm not sure how my VBO and TBO associate with a specific uniform samplerBuffer in my shader, I have not linked them using the location or the vbo/tbo together. It seems to still work ...
1
vote
1answer
79 views

Most common format & good practice for 3D models for a placeholder in a PC game [closed]

I'm soon starting programming my first 3D game in OpenGL, C++, for PC. It's going to be a top-down space-based game. Early on I want to create basic placeholder 3D models for my objects, and then in ...
1
vote
1answer
62 views

OpenGL Fragment Shader Interpolation Vs Inverse Calculation

I have found openGL fragment shader tutorials on the web, some that use use inverse calculations to revert the fragment coordinate back to the world space and others that interpolate the position. ...
1
vote
1answer
105 views

How Extract Frustum Planes from Clip Coordinates?

I'm having some problems with my Frustum Culling and I want to debug it, so I'm trying to render it's planes, to see exatly the Frustum. But I'm using the Clip Coordinates to do the culling (like ...
1
vote
1answer
64 views

How to draw a plane equivalent to a given btStaticPlaneShape using OpenGL

With all other shapes in bullet, you can easily get the transform from the MotionState which holds the origin, the scale, and the rotation. There seems to be no way to get the same information about a ...
1
vote
1answer
89 views

recommended shader pipeline infrastructure in core opengl 3.3

I am writing a game project in Go and I am using an OpenGl 3.3 core context to do my rendering stuff. At the moment I have different types of renderers. Each renderer has it's own pair of vertex- and ...
1
vote
2answers
193 views

How can I use ARB_debug_output with SDL on Windows?

I'm trying to port a small GL program that I've been working on from Linux to Windows. I have the following: window_ = SDL_CreateWindow(...); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, ...
1
vote
1answer
58 views

Indirect indexing (uv coords read from texture)

In the vertex shader, I need to make a texture fetch, where the texture coordinate itself is read from some other texture. vec2 uv = texture(someTexture,coords).xy; vec4 val = ...
1
vote
1answer
112 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
1
vote
1answer
232 views

What does “GL_CLAMP_TO_EDGE should be used in NPOT textures” mean?

I have two sRGB PNG images I am using for textures. One is 64x64, and works fine. The other is 64x47, and when I attempt to use it I get an error: reason: 'GL_CLAMP_TO_EDGE should be used in NPOT ...
1
vote
1answer
85 views

Floating point memory usage on gpu

My question is simple: how much memory on GPU does one floating point value takes? I guess it is 4 bytes, but I'm not sure. So for example is it true that vec4, which holds 4 floats, each 4 bytes ...
1
vote
2answers
161 views

Tangent on generated sphere

I have difficulties understanding the tangent/bitangent concept for normal mapping, or rather the calculations of them. I draw a sphere which is generated with the code in the OpenGL redbook ...
1
vote
1answer
208 views

glGenerateMipmap confusion

I'm trying to get a grip on mipmaps with OpenGL. I believe I understand the concept, but when trying to have OpenGL generate them I wonder how it determines how many mipmaps to generate? Here's what ...
1
vote
1answer
152 views

How can I improve the performance of texture switching without resorting to atlasing?

I'd like to use texture images that are not a sprite sheet or other form of texture atlas, mainly because I'll be consistently adding and swapping textures while I figure out the direction my game ...
1
vote
1answer
246 views

View to normal calculation in GLSL

Sorry for the terrible title, but I really cant think of anything better.. Suggestions welcome. I am trying to do something like showcased in this video: http://www.youtube.com/watch?v=CaTI2d0tQME ...
1
vote
1answer
670 views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
1
vote
3answers
158 views

Optimal number of work groups for compute shaders

In OpenGL, is there a way to dynamically determine the preferred workgroup size of the underlying hardware? Or at least, to approximate it using some queried metrics? In OpenCL, you can do this using ...
1
vote
1answer
137 views

How does HLSL handle clip(vector)?

My goal is to convert clip() to GLSL, version 1.5. I'm currently doing a basic: if (x < 0) discard; But if x is not a scalar, obviously I can't use the "<" operator. So I'm wanting to ...
1
vote
1answer
153 views

OpenGL Texture loaded but wont draw on Bind

I wrote my entire Texture loader by hand. I'm not using any Libraries. From what I gather the loading part is done correctly and stored in the texture class: Texture* TGATextureLoader::create(const ...
1
vote
1answer
134 views

What is the difference between shader uniforms and attributes in OpenGL?

I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes. Can uniforms change for each vertex? I mean to calculate the vertex's ...
1
vote
1answer
172 views

How many VBOs should I use and should I keep a copy of their data?

Firstofall, I am sorry if my question is to broad. I am developing a tile based game and switched from those gl.Begin calls to using VBOs. This is kind of working allready, I managed to render a ...
1
vote
1answer
215 views

Infinite terrain shadows

I'm creating an infinite terrain engine, which generates the terrain either with fractals or noise. How can I make dynamic shadows for the sun on this terrain, if I don't know in advance what will be ...
1
vote
1answer
192 views

Black or White Border/Shadow around PNGs in SDL/OPENGL

having the same issue as this: Why do my sprites have a dark shadow/line/frame surrounding the texture? however, when I do the fix suggested there (changing GL_SRC_ALPHA to GL_ONE) it just replaces ...
1
vote
1answer
146 views

Reading from depth textures always returns 1

I create a packed depth/stencil texture and attach it to a framebuffer like this: glGenTextures(1,&_depthStencilTexture); glBindTexture(GL_TEXTURE_2D,_depthStencilTexture); //set filtering to ...
1
vote
1answer
103 views

Plot 3D function with OpenGL [closed]

I need to build some sort of engine that can take a multivariable function such as f(x,y) = cos(x) + y and produce it's graph in 3D space. Is there a recommended method of doing that?
1
vote
1answer
99 views

How to render models using a personalized projection matrix?

I'm creating a game with a great sprite demand. Out team is considering automatizing the sprite generation using 3D models. The problem is we have a very particular ortographic projection: We have ...
1
vote
1answer
69 views

Pyglet: How to use second screen's vsync

does anybody know if it's possible to use the vsync of the second monitor instead of the first one with pyglet? I have 2 monitors, one running at 60Hz and the other at 120Hz. I want to be able to ...
1
vote
2answers
384 views

OpenGL draws draw buffers in wrong order

I'm trying to implement deferred rendering and for now I only have diffuse, normal (in world space) and position (in world space) as textures inside the GBuffer. I create the GBuffer like this: void ...