Hi,
I am rendering a skybox using a cubemap. Since the positive and negative y faces are oriented strangely (i.e., mirrored and flipped) compared to the other x and z faces, my rendering code manipulates the glTexCoord3f() calls to fix this. The skybox renders correctly on my WinXP box with a 9700Pro (cat 4.5 drivers). However I notice intermittent white dots appearing along some of the seams between cube faces. Since I am already using GL_CLAMP_TO_EDGE for the cubemap I am a bit puzzled as to why this is happening. I tested it on another WinXP box with a Geforce2 (old det 43 driver) and the white dots were not as noticeable – but they were still present. Since this problem is appearing on both machines I’m pretty sure that I’ve screwed up my code somewhere
Here’s the code I use to render my skybox. I’ve already bound the cubemap elsewhere to texture unit zero.
GLvoid RenderSkybox(GLfloat width, GLfloat height, GLfloat depth)
{
GLfloat dx = width * 0.5f;
GLfloat dy = height * 0.5f;
GLfloat dz = depth * 0.5f;
glPushAttrib(GL_FOG_BIT | GL_DEPTH_BUFFER_BIT | GL_LIGHTING_BIT);
glDisable(GL_FOG);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glBegin(GL_QUADS);
// Front (negative Z) face.
glTexCoord3f( dx, -dy, -dz); glVertex3f(-dx, -dy, -dz);
glTexCoord3f(-dx, -dy, -dz); glVertex3f( dx, -dy, -dz);
glTexCoord3f(-dx, dy, -dz); glVertex3f( dx, dy, -dz);
glTexCoord3f( dx, dy, -dz); glVertex3f(-dx, dy, -dz);
// Back (positive Z) face.
glTexCoord3f(-dx, -dy, dz); glVertex3f( dx, -dy, dz);
glTexCoord3f( dx, -dy, dz); glVertex3f(-dx, -dy, dz);
glTexCoord3f( dx, dy, dz); glVertex3f(-dx, dy, dz);
glTexCoord3f(-dx, dy, dz); glVertex3f( dx, dy, dz);
// Bottom (negative Y) face.
glTexCoord3f( dx, -dy, -dz); glVertex3f(-dx, -dy, dz);
glTexCoord3f(-dx, -dy, -dz); glVertex3f( dx, -dy, dz);
glTexCoord3f(-dx, -dy, dz); glVertex3f( dx, -dy, -dz);
glTexCoord3f( dx, -dy, dz); glVertex3f(-dx, -dy, -dz);
// Top (positive Y) face.
glTexCoord3f( dx, dy, dz); glVertex3f(-dx, dy, -dz);
glTexCoord3f(-dx, dy, dz); glVertex3f( dx, dy, -dz);
glTexCoord3f(-dx, dy, -dz); glVertex3f( dx, dy, dz);
glTexCoord3f( dx, dy, -dz); glVertex3f(-dx, dy, dz);
// Left (negative X) face.
glTexCoord3f( dx, -dy, dz); glVertex3f( dx, -dy, -dz);
glTexCoord3f( dx, -dy, -dz); glVertex3f( dx, -dy, dz);
glTexCoord3f( dx, dy, -dz); glVertex3f( dx, dy, dz);
glTexCoord3f( dx, dy, dz); glVertex3f( dx, dy, -dz);
// Right (positive X) face.
glTexCoord3f(-dx, -dy, -dz); glVertex3f(-dx, -dy, dz);
glTexCoord3f(-dx, -dy, dz); glVertex3f(-dx, -dy, -dz);
glTexCoord3f(-dx, dy, dz); glVertex3f(-dx, dy, -dz);
glTexCoord3f(-dx, dy, -dz); glVertex3f(-dx, dy, dz);
glEnd();
glPopAttrib();
}
Any ideas?