Original Post
Hi all. I have some problem with reflective environment mapping in OpenGL (both fixed function + shader). Maybe it's just a matter of misunderstanding, but let me try: I have a simple quad facing along the positive x-axis (normal = (1, 0, 0)). I enabled fixed function environment mapping, since I tend to say my shader could be incorrect, but fixed function should work correctly. My code: This works, but IMHO uncorrectly: For testing purposes I've disabled backface culling so I would see both sides. Now I'd expect to see a different reflection on both sides ( on one side the left part of the cube, on the other side the right part) as I would see when looking into a 2-sided mirror. Now here's the problem: every side of the quad shows the same reflection. Moreover I tried this with a hard cube (every side having a distinct normal) -> every side showed the same reflection if I was right in front of it and look at its center (same relative position). IMO that's not correct. Using Cg shaders it's the same result. So what went wrong? I'd guess that could be a driver error but I'm rather slow in blaming others. First I'd like to confirm that it's not me ;/. Could anyone provide a simple, running cube environment mapping example in OpenGL that I could test my driver with (preferably prebuilt for Windows ;))?
glDisable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_CUBE_MAP);
glBindTexture(&cubemapID);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
glPushMatrix();
glBegin(GL_TRIANGLE_STRIP);
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(6.0f,-6.0f,-6.0f);
glVertex3f(6.0f, 6.0f,-6.0f);
glVertex3f(6.0f,-6.0f, 6.0f);
glVertex3f(6.0f, 6.0f, 6.0f);
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);