Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#Actualdr4cula

Posted 25 July 2013 - 08:08 AM



if you are using intel express graphics card (from notebooks) it is likely you wont see shadowmaps at all

 

Nah, I'm on nVidia's GTX580.

 

So, I had a look at my code from a different perspective this time, assuming that the depth buffer got mapped correctly into texture memory. And I found a different problematic area: I had a problem with this beforehand but somewhere, somehow with all the changes I did to my code it had disappeared. However, now it's back. Basically, as soon as I switch to this scene, I get a white/black variation of the scene viewed from the light's position (I can tell due to the angle one of the walls is at). What I think is happening, is that the first renderSceneElements() renders onto the frame buffer as well (not just the depth buffer) and when I call it the second time, the first rendered image (due to projection settings) wins the depth test and the second image is rendered "underneath" it. When I'm moving around with the camera through the scene, I can still see the rest of the scene but the first render is stuck on top of it.

 

Now, I tried using glColorMask(false...) just before the first render and glColorMask(true...) just after the render but now instead of white shapes from the first render I get black shapes (or whatever glClearColor() is set to).

 

Here's my full code:

 

init:

void Scene_Shadowmap::init() {
lightPos_[0] = 25.0f;
lightPos_[1] = 2.0f;
lightPos_[2] = 10.0f;
lightPos_[3] = 1.0f;
 
lightFOV_ = 45.0f;
lightAspect_ = 1.0f;
lightNear_ = 1.0f;
lightFar_ = 8.0f;
 
glGenTextures(1, &shadowmap_);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 512, 512, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
}
 
render:
 
void Scene_Shadowmap::render() {
GLenum error = glGetError();
 
glClearColor(0.5, 0.2, 0.1, 1.0f);
// position the light
glLightfv(GL_LIGHT0, GL_POSITION, lightPos_);
 
// set up the projection parameters from the light's POV
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
 
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
// translate to the light's position
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glColorMask(false, false, false, false);
// render the scene to get the depth information
renderSceneElements();
glColorMask(true, true, true, true);
glPopMatrix();
 
// end the projection modification
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
 
// copy over the depth information
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 512, 512);
 
// matrix defining the planes for S, Q, R, T components for texture generation
float planeMatrix[16];
glPushMatrix();
glLoadIdentity();
// compensate for the eye-coordinate to texture coordinate conversion: [-1,1] to [0,1]
glTranslatef(0.5f, 0.5f, 0.0f);
glScalef(0.5f, 0.5f, 1.0f);
 
// do the perspective projection and translate to the light's position
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glGetFloatv(GL_MODELVIEW_MATRIX, planeMatrix);
glPopMatrix();
 
// go from OpenGL's column-major to row-major matrix form
transposeMatrix16(planeMatrix);
 
// set up the texture parameters for the shadowmap
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
 
// set up the type for texture generation
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
 
// data for texture generation
glTexGenfv(GL_S, GL_OBJECT_PLANE, &planeMatrix[0]);
glTexGenfv(GL_T, GL_OBJECT_PLANE, &planeMatrix[4]);
glTexGenfv(GL_Q, GL_OBJECT_PLANE, &planeMatrix[8]);
glTexGenfv(GL_R, GL_OBJECT_PLANE, &planeMatrix[12]);
 
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_Q);
glEnable(GL_TEXTURE_GEN_R);
 
glEnable(GL_TEXTURE_2D);
 
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
 
renderSceneElements();
 
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);
 
/*
glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
glTranslatef(3.0f, 2.0f, 5.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 0.0f);
glVertex3f(3.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 1.0f);
glVertex3f(3.0f, 3.0f, 0.0f);
 
glTexCoord2f(0.0f, 1.0f);
glVertex3f(0.0f, 3.0f, 0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
*/
 
glDisable(GL_TEXTURE_2D);
 
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_S);
}
 
The scene renders fine when I disable the call to gluPerspective() before the first render but that's because the gluPerspective() matches the one used for rendering the scene afterwards (why aren't the push/pop matrix functions isolating that call?).
 
The renderSceneElements() renders just a bunch of VAOs where I have disabled all of the texturing/lighting calls so only the vertices/normals states are enabled.
 
Visual representation: (on the left call to the first gluPerspective() is commented out, on the right everything is the same as posted above)
 
9uqi45.png
 
If I move out of the "room":
 
213oubb.jpg
 
Hope you guys can help me out.
 
Thanks in advance!

#2dr4cula

Posted 25 July 2013 - 08:08 AM



if you are using intel express graphics card (from notebooks) it is likely you wont see shadowmaps at all

 

Nah, I'm on nVidia's GTX580.

 

So, I had a look at my code from a different perspective this time, assuming that the depth buffer got mapped correctly into texture memory. And I found a different problematic area: I had a problem with this beforehand but somewhere, somehow with all the changes I did to my code it had disappeared. However, now it's back. Basically, as soon as I switch to this scene, I get a white/black variation of the scene viewed from the light's position (I can tell due to the angle one of the walls is at). What I think is happening, is that the first renderSceneElements() renders onto the frame buffer as well (not just the depth buffer) and when I call it the second time, the first rendered image (due to projection settings) wins the depth test and the second image is rendered "underneath" it. When I'm moving around with the camera through the scene, I can still see the rest of the scene but the first render is stuck on top of it.

 

Now, I tried using glColorMask(false...) just before the first render and glColorMask(true...) just after the render but now instead of white shapes from the first render I get black shapes (or whatever glClearColor() is set to).

 

Here's my full code:

 

init:

void Scene_Shadowmap::init() {
lightPos_[0] = 25.0f;
lightPos_[1] = 2.0f;
lightPos_[2] = 10.0f;
lightPos_[3] = 1.0f;
 
lightFOV_ = 45.0f;
lightAspect_ = 1.0f;
lightNear_ = 1.0f;
lightFar_ = 8.0f;
 
glGenTextures(1, &shadowmap_);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 512, 512, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
}
 
render:
 
void Scene_Shadowmap::render() {
GLenum error = glGetError();
 
glClearColor(0.5, 0.2, 0.1, 1.0f);
// position the light
glLightfv(GL_LIGHT0, GL_POSITION, lightPos_);
 
// set up the projection parameters from the light's POV
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
 
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
// translate to the light's position
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glColorMask(false, false, false, false);
// render the scene to get the depth information
renderSceneElements();
glColorMask(true, true, true, true);
glPopMatrix();
 
// end the projection modification
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
 
// copy over the depth information
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 512, 512);
 
// matrix defining the planes for S, Q, R, T components for texture generation
float planeMatrix[16];
glPushMatrix();
glLoadIdentity();
// compensate for the eye-coordinate to texture coordinate conversion: [-1,1] to [0,1]
glTranslatef(0.5f, 0.5f, 0.0f);
glScalef(0.5f, 0.5f, 1.0f);
 
// do the perspective projection and translate to the light's position
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glGetFloatv(GL_MODELVIEW_MATRIX, planeMatrix);
glPopMatrix();
 
// go from OpenGL's column-major to row-major matrix form
transposeMatrix16(planeMatrix);
 
// set up the texture parameters for the shadowmap
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
 
// set up the type for texture generation
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
 
// data for texture generation
glTexGenfv(GL_S, GL_OBJECT_PLANE, &planeMatrix[0]);
glTexGenfv(GL_T, GL_OBJECT_PLANE, &planeMatrix[4]);
glTexGenfv(GL_Q, GL_OBJECT_PLANE, &planeMatrix[8]);
glTexGenfv(GL_R, GL_OBJECT_PLANE, &planeMatrix[12]);
 
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_Q);
glEnable(GL_TEXTURE_GEN_R);
 
glEnable(GL_TEXTURE_2D);
 
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
 
renderSceneElements();
 
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);
 
/*
glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
glTranslatef(3.0f, 2.0f, 5.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 0.0f);
glVertex3f(3.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 1.0f);
glVertex3f(3.0f, 3.0f, 0.0f);
 
glTexCoord2f(0.0f, 1.0f);
glVertex3f(0.0f, 3.0f, 0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
*/
 
glDisable(GL_TEXTURE_2D);
 
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_S);
}
 
The scene renders fine when I disable the call to gluPerspective() before the first render but that's because the gluPerspective() matches the one used for rendering the scene afterwards (why aren't the push/pop matrix functions isolating that call?).
 
The renderSceneElements() renders just a bunch of VAOs where I have disabled all of the texturing/lighting calls so only the vertices/normals states are enabled.
 
Visual representation: (on the left call to the first gluPerspective() is commented out, on the right everything is the same as posted above)
 
9uqi45.png
 
If I move out of the "room":
213oubb.jpg
 
Hope you guys can help me out.
 
Thanks in advance!

#1dr4cula

Posted 25 July 2013 - 08:04 AM



if you are using intel express graphics card (from notebooks) it is likely you wont see shadowmaps at all

 

Nah, I'm on nVidia's GTX580.

 

So, I had a look at my code from a different perspective this time, assuming that the depth buffer got mapped correctly into texture memory. And I found a different problematic area: I had a problem with this beforehand but somewhere, somehow with all the changes I did to my code it had disappeared. However, now it's back. Basically, as soon as I switch to this scene, I get a white/black variation of the scene viewed from the light's position (I can tell due to the angle one of the walls is at). What I think is happening, is that the first renderSceneElements() renders onto the frame buffer as well (not just the depth buffer) and when I call it the second time, the first rendered image (due to projection settings) wins the depth test and the second image is rendered "underneath" it. When I'm moving around with the camera through the scene, I can still see the rest of the scene but the first render is stuck on top of it.

 

Now, I tried using glColorMask(false...) just before the first render and glColorMask(true...) just after the render but now instead of white shapes from the first render I get black shapes (or whatever glClearColor() is set to).

 

Here's my full code:

 

init:

void Scene_Shadowmap::init() {
lightPos_[0] = 25.0f;
lightPos_[1] = 2.0f;
lightPos_[2] = 10.0f;
lightPos_[3] = 1.0f;
 
lightFOV_ = 45.0f;
lightAspect_ = 1.0f;
lightNear_ = 1.0f;
lightFar_ = 8.0f;
 
glGenTextures(1, &shadowmap_);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 512, 512, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
}
 
render:
 
void Scene_Shadowmap::render() {
GLenum error = glGetError();
 
glClearColor(0.5, 0.2, 0.1, 1.0f);
// position the light
glLightfv(GL_LIGHT0, GL_POSITION, lightPos_);
 
// set up the projection parameters from the light's POV
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
 
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
// translate to the light's position
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glColorMask(false, false, false, false);
// render the scene to get the depth information
renderSceneElements();
glColorMask(true, true, true, true);
glPopMatrix();
 
// end the projection modification
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
 
// copy over the depth information
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 512, 512);
 
// matrix defining the planes for S, Q, R, T components for texture generation
float planeMatrix[16];
glPushMatrix();
glLoadIdentity();
// compensate for the eye-coordinate to texture coordinate conversion: [-1,1] to [0,1]
glTranslatef(0.5f, 0.5f, 0.0f);
glScalef(0.5f, 0.5f, 1.0f);
 
// do the perspective projection and translate to the light's position
gluPerspective(lightFOV_, lightAspect_, lightNear_, lightFar_);
gluLookAt(lightPos_[0], lightPos_[1], lightPos_[2], -1.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f);
 
glGetFloatv(GL_MODELVIEW_MATRIX, planeMatrix);
glPopMatrix();
 
// go from OpenGL's column-major to row-major matrix form
transposeMatrix16(planeMatrix);
 
// set up the texture parameters for the shadowmap
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
 
// set up the type for texture generation
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
 
// data for texture generation
glTexGenfv(GL_S, GL_OBJECT_PLANE, &planeMatrix[0]);
glTexGenfv(GL_T, GL_OBJECT_PLANE, &planeMatrix[4]);
glTexGenfv(GL_Q, GL_OBJECT_PLANE, &planeMatrix[8]);
glTexGenfv(GL_R, GL_OBJECT_PLANE, &planeMatrix[12]);
 
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_Q);
glEnable(GL_TEXTURE_GEN_R);
 
glEnable(GL_TEXTURE_2D);
 
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
 
renderSceneElements();
 
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);
 
/*
glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, shadowmap_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
glTranslatef(3.0f, 2.0f, 5.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 0.0f);
glVertex3f(3.0f, 0.0f, 0.0f);
 
glTexCoord2f(1.0f, 1.0f);
glVertex3f(3.0f, 3.0f, 0.0f);
 
glTexCoord2f(0.0f, 1.0f);
glVertex3f(0.0f, 3.0f, 0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
*/
 
glDisable(GL_TEXTURE_2D);
 
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_S);
}
 
The scene renders fine when I disable the call to gluPerspective() before the first render but that's because the gluPerspective() matches the one used for rendering the scene afterwards (why aren't the push/pop matrix functions isolating that call?).
 
The renderSceneElements() renders just a bunch of VAOs where I have disabled all of the texturing/lighting calls so only the vertices/normals states are enabled.
 
Visual representation: (on the left call to the first gluPerspective() is commented out, on the right everything is the same as posted above)
 
9uqi45.png
 
Hope you guys can help me out.
 
Thanks in advance!

PARTNERS