Also remember that glReadPixels is not guaranteed to return valid data if the frame buffer itself is (partially) off-screen or obscured by other windows. Only if you can see the region on your...
Type: Posts; User: remdul
Also remember that glReadPixels is not guaranteed to return valid data if the frame buffer itself is (partially) off-screen or obscured by other windows. Only if you can see the region on your...
If you simply want to draw the skeleton of an animated character (e.g. for debugging purposes), calling glDisable(GL_DEPTH_TEST) before drawing the lines should be sufficient.
If you desire proper...
From your description it seems the frame buffer contents is left in the client area (aka 'garbage')? Did you try refreshing/redrawing the window client area after GL destruction?
If none of that...
Strictly speaking, "OpenGL" cannot crash a computer, but your graphics drivers can. Graphics drivers are an implementation of OpenGL created by NVidia, AMD/ATI, Intel etc. Depending on the quality of...
If I remember correctly, it is as simple as computing the distance between the object and camera position, and scaling the object by that. You may need to tweak the default scale, and if the field of...
Avoid BMP, it is a pretty messy format. I would suggest TGA instead. It has a much cleaner structure, no problems with pixel padding/byte alignment, supports the same formats and more (paletted...
Wildfire Games has some statistics presented in an interesting way here: http://feedback.wildfiregames.com/report/opengl/
IMO, it would be very helpful to have something similar hosted at...
Also remember to reset the texture depth compare parameter when rendering the depth texture for debugging purposes ("sampler2D"):
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
There's a freely available GLSL parsing library by 3DLabs, google for "GLSLValidate". However it is no longer updated (IIRC only supports up to GLSL1.x) but might be useful. I have used it before,...
What thokra said, first determine what the bottleneck is (fill rate? data transfer? etc). The steep drop to ~2fps seems more like it falls to software rendering however.
You may also see a...
There's a paper and some slides (PDF) by the guys from Crytek, where they explain this in detail how this was done in Crysis 1 (IIRC it includes some shader sample code). I also seem to recall DICE...
Assuming the flicker you see is actually 'shimmer' (or 'jitter') of the tree leaf textures, the proper way to solve this is to enable mipmapping. At any rate, it has little to do with z-buffer (and...
zeoverlord isn't wrong, but to be pedantic... :p
If you are using Fixed Function functionality (aka FFP) of OpenGL (pre GL2.0, no GLSL shaders), then scaling with glScalef will actually affect...
I'm not sure if 3d textures or texture arrays are what you really want (it depends on what data you have and what you want to render).
Many modern games store textures in atlasses. They pack...
As pointed out above, use alpha blending for GL_LINE_SMOOTH. Call glLineWidth to tweak the thickness when wider than 1px (with alpha=1.0). To draw lines that appear thinner than 1px, scale the alpha,...
I can only suggest to check out transformation matrices, specifically 4x4 matrices used in OpenGL. Essentially it stores the same stuff you have in your structure, and more.
A 4x4 OpenGL-style...
What Alfonse means is that you should loop through the light sources in your GLSL shader when drawing the shadow receiver. Compute the lighting (N dot L etc) and sample the per-light source shadow...
I've had some luck now by disabling multi-sampling and downsizing FBOs.
There is no clear distinction in OpenGL between 2D and 3D rendering, and as such, 2D rendering is similar to 3D. There are some direct frame buffer operations you can do (particularly glDrawPixels),...
Aah, thanks Eric, I now get it, and thanks for the links.
Because I was under the erroneous impression that ftransform() was required for polygon offset to work. I must have had a bug in my...
I've seen many variants of GLSL shader samples that simulate FFP rendering, but none that covered polygon offset.
According to the spec/manual, polygon offset is a fragment operation, not...
If you want to keep things *really* simple, and you don't need self-shadowing (e.g. merely render silouettes to a grayscale texture), then you could do the following:
When rendering to texture......
Oops, looks like it was a false alarm.
After some code changes my bug was inexplicably fixed. It may have to do with dynamic branching and the driver optimizing some stuff away, causing...
Anyone noticed that a float uniform named "hasAlpha" will always be filled with the value 1.0? Happens on some NV hardware/drivers. Everything works fine when I pick another name.
I'm guessing it...
You're confusing the size of the array with the number of elements of the vertex attribute.
Whatever vertex attributes you are enabling (vertex/position/normal/color), they must all have the same...