Top "Opengl" questions

OpenGL (Open Graphics Library) is a graphics standard and API which is platform independent and available for desktop, workstation and mobile devices.

What is the correct field of view angle for human eye?

At the moment i use 45 degree angle for my gluPerspective(). Is this the correct angle to make the rendering look …

opengl rendering fieldofview
glVertexAttribPointer clarification

Just want to make sure I understand this correctly (I'd ask on SO Chat, but it's dead in there!): We've …

opengl
How do you get the modelview and projection matrices in OpenGL?

I am trying to use the OpenGL Shading Language (GLSL) version 1.5 to make vertex and geometry shaders. I have learned …

opengl glsl
In OpenGL vertex shaders, what is w, and why do I divide by it?

void main(void) { vec4 clipCoord = glModelViewProjectionmatrix * gl_Vertex; gl_Position = clipCoord; gl_FrontColor = gl_Color; vec3 ndc = clipCoord.xyz / clipCoord.…

opengl vertex-shader
Getting the true z value from the depth buffer

Sampling from a depth buffer in a shader returns values between 0 and 1, as expected. Given the near- and far- clip …

opengl graphics shader
GLSL: How to get pixel x,y,z world position?

I want to adjust the colors depending on which xyz position they are in the world. I tried this in …

opengl glsl fragment-shader
C++ bad_alloc at memory location Exception

Unhandled exception at 0x758cd36f in OSGP.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0028ef70.. …

c++ visual-studio-2010 opengl openscenegraph
How to calculate Tangent and Binormal?

Talking about bump mapping, specular highlight and these kind of things in OpenGL Shading Language (GLSL) I have: An array …

math opengl 3d glsl shader
How to load a bmp on GLUT to use it as a texture?

I've been searching all around for a simple solution to add sprites to my OpenGl GLUT simple moon lander game …

c++ opengl textures glut bmp
texture vs texture2D in GLSL

When sampling a 2D texture in GLSL (a uniform sampler2D), the texture function is used and the dimension is …

opengl glsl