Original Post
Hey everyone! Hopefully just a quick question here! I'm using the following static image cubemap for my skybox: My Cubemap However, when I render this through OpenGL, I get lines where my quads intersect: Line Vertical on the Right Line on the Right and across the Centre of the Screen I think this is something to do with texture parameters, so I have this set on my newly generated textures: My rendering code is as follows: Other than me not setting the correct texture parameter, I had the idea that I could extend the quads so that they intersect at the edges, but I decided that might be quite difficult to write texture co-ordinates for. Is there a quick solution to my problem or a standard way of getting around it? Many Thanks, Sputty! [Edited by - LordSputnik on November 19, 2009 4:50:36 PM]
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glEnable(GL_TEXTURE_2D);
TexMgr.SetCurrent(Texture[0]);
glBegin(GL_QUADS);
/** Front Face **/
glTexCoord2d(0.25f,0);
glVertex3f( -500.0f, 500.0f, -500.0f );
glTexCoord2d(0.25f,0.25f);
glVertex3f( -500.0f, -500.0f, -500.0f );
glTexCoord2d(0.5f,0.25f);
glVertex3f( 500.0f, -500.0f, -500.0f );
glTexCoord2d(0.5f,0);
glVertex3f( 500.0f, 500.0f, -500.0f );
/** Back Face **/
glTexCoord2d(0.25f, 0.75f);
glVertex3f( -500.0f, 500.0f, 500.0f );
glTexCoord2d(0.25f, 0.5f);
glVertex3f( -500.0f, -500.0f, 500.0f );
glTexCoord2d(0.5f, 0.5f);
glVertex3f( 500.0f, -500.0f, 500.0f );
glTexCoord2d(0.5f, 0.75f);
glVertex3f( 500.0f, 500.0f, 500.0f );
/** Left Face **/
glTexCoord2d(0, 0.25f);
glVertex3f( -500.0f, 500.0f, -500.0f );
glTexCoord2d(0.25f, 0.25f);
glVertex3f( -500.0f, -500.0f, -500.0f );
glTexCoord2d(0.25f, 0.5f);
glVertex3f( -500.0f, -500.0f, 500.0f );
glTexCoord2d(0, 0.5f);
glVertex3f( -500.0f, 500.0f, 500.0f );
/** Right Face **/
glTexCoord2d(0.75f, 0.25f);
glVertex3f( 500.0f, 500.0f, -500.0f );
glTexCoord2d(0.5f, 0.25f);
glVertex3f( 500.0f, -500.0f, -500.0f );
glTexCoord2d(0.5f, 0.5f);
glVertex3f( 500.0f, -500.0f, 500.0f );
glTexCoord2d(0.75f, 0.5f);
glVertex3f( 500.0f, 500.0f, 500.0f );
/** Top Face **/
glTexCoord2d(1, 0.25f);
glVertex3f( -500.0f, 500.0f, -500.0f );
glTexCoord2d(0.75f, 0.25f);
glVertex3f( 500.0f, 500.0f, -500.0f );
glTexCoord2d(0.75f, 0.5f);
glVertex3f( 500.0f, 500.0f, 500.0f );
glTexCoord2d(1, 0.5f);
glVertex3f( -500.0f, 500.0f, 500.0f );
/** Bottom Face **/
glTexCoord2d(0.5f, 0.5f);
glVertex3f( 500.0f, -500.0f, 500.0f );
glTexCoord2d(0.25f, 0.5f);
glVertex3f( -500.0f, -500.0f, 500.0f );
glTexCoord2d(0.25f, 0.25f);
glVertex3f( -500.0f, -500.0f, -500.0f );
glTexCoord2d(0.5f, 0.25f);
glVertex3f( 500.0f, -500.0f, -500.0f );
glEnd();
glDisable(GL_TEXTURE_2D);
