Sky box (I know, I know)

Okay, I know everyone says the way to get rid of the border lines in a skybox is to do a:
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

Or you can substitute GL_CLAMP for CL_CLAMP_TO_EDGE. Either way, it doesn’t work for me. Anybody got any other ideas? Thanks!

You must use GL_CLAMP_TO_EDGE. GL_CLAMP will clamp to border color instead.

I heard it through the grapvine that NVidia hardware up to and including the Geforce2 series can’t do that particular clamp mode. GF3 is fine though.

Actually, through Geforce2 can’t do GL_CLAMP (GL_CLAMP_TO_EDGE is substituted). And the Geforce3 has the wrong behavior by default (you need to set a registry flag to get correct behavior).

Okay, guys. Whether GL_CLAMP or GL_CLAMP_TO_EDGE is needed doesn’t matter because my point is, NEITHER work. I’ve tested it on both a GF2 and a Matrox G450. So does anybody have any ideas OTHER than GL_CLAMP*?

Just to be certain, you are disabling lighting when drawing the sky box, correct?

Don’t use mipmaps

Yes, lighting is off and I’m not using mipmaps.

And I call the two above listed lines of code before calling my texture loading function.

Are you using a cube for the sky box? If so, are you certain the textures you are using each have a 90 degree FOV?

Yes, I’m sure. I’m using the same standard skybox textures that many others have used with success.

Can you upload it (example executable or source)? Might make it easier for others to see what’s wrong.

Dont have much time but consider using something like the following code snip. My skyboxes are completely seamless.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Render this instance.

void MgSkyBox::render()
{
e_StateManager.enable(GL_TEXTURE_2D);
e_StateManager.disable(GL_LIGHTING);
e_StateManager.enable(GL_TEXTURE_CUBE_MAP_ARB);
// e_StateManager.disable(GL_DEPTH_TEST);

glDepthMask(FALSE);
glPushMatrix();
glScalef(m_Dimensions[0],m_Dimensions[1],m_Dimensions[2]);
DrawTexturedCube(m_Textures);
glPopMatrix();
glDepthMask(TRUE);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Set the texture objects and apply the necessary properties to each (order
// is Top, Bottom, Right, Left, Front, Back

void MgSkyBox::setTextures(long textureIndices[6])
{
memcpy(m_Textures,textureIndices,sizeof(long)*6);

// Detect the GL_EXT_texture_edge_clamp extension and use it if present
int clampMode;

if (IsOpenGlExtensionSupported(“GL_EXT_texture_edge_clamp”))
{
clampMode = GL_CLAMP_TO_EDGE;
}
else
{
clampMode = GL_CLAMP;
}
for (int i=0; i<6; ++i)
{
glBindTexture(GL_TEXTURE_2D,m_Textures[i]);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,clampMode);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,clampMode);
}
}

Maybe you can try GL_CLAMP_TO_BORDER

vincoof, I’ll give it a shot. Would you happen to have the enum value for that? Thanks.

#define GL_CLAMP_TO_EDGE 0x812F
#define GL_CLAMP_TO_EDGE_SGIS 0x812F

#define GL_CLAMP_TO_BORDER_SGIS 0x812D
#define GL_CLAMP_TO_BORDER_ARB 0x812D

Note that you have to support the extension GL_ARB_texture_border_clamp or GL_SGIS_texture_border_clamp, which is supported by GeForce3+ and Radeon8500 and a few other cards.