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
235 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
746 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
297 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
540 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
710 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
850 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
936 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
566 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
150 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
101 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
67 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
61 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
104 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
61 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
88 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
183 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
228 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
160 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
203 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
151 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
237 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
649 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
136 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
148 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
129 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
171 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
212 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
188 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
67 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
381 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 ...
1
vote
1answer
104 views

Understanding VAOs and adding different arrays to VAOs

I'm really confused on what you do. I can do them, however I got this problem. Say you have several squares, say 1,000 squares. Now I can make a VAO for each 1,000 squares and then do some for loop to ...
1
vote
1answer
448 views

OpenGL FBO, render off screen and texture

I need to do some offscreen render to use the rendered image in something different from OpenGL context (for instance I need to use the image in a QListWidgetItem inside a Qt application). After ...
1
vote
1answer
174 views

How to deal with lot of textures in one draw call?

I'am currently developing text rendering & some kind of tile based texturing for simple landscape with textures blending. e.g. something like this but in 3D. In first realization I have been used ...
1
vote
1answer
310 views

How to do directional per fragment lighting in world space?

I am attempting to create a GLSL shader for simple, per-fragment directional light. So far, after following many tutorials, I have continually ran into the issue: my light is specified in world ...
1
vote
1answer
395 views

Playing movies with OpenGL in Java

I am trying to play a movie file into an OpenGL texture in a Java application. I am using JOGL and have a basic OpenGL scene, but I have no idea how to play a movie into a texture. The only thing I ...