Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

carb

Silly Prob connecting Quads

This topic is 5397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here''s a pic from my work-in-progress terrain renderer: Notice the lines between the skybox quads. Now, if you''ll notice, there''s none of this junk in my terrain ... so why are these popping up now? I assure you the coords line up, but here''s the code just in case.
void SkyBox::render() {
   // disable lighting temporarily
   glDisable(GL_LIGHTING);

   // top
   glBindTexture(GL_TEXTURE_2D, m_textures[0]);
   glBegin(GL_QUADS);
      glTexCoord2f(0.0f, 1.0f);
      glVertex3f(-2000.0f,2000.0f, 500.0f);
      glTexCoord2f(1.0f, 1.0f);
      glVertex3f(2000.0f, 2000.0f, 500.0f);
      glTexCoord2f(1.0f, 0.0f);
      glVertex3f(2000.0f, -2000.0f, 500.0f);
      glTexCoord2f(0.0f, 0.0f);
      glVertex3f(-2000.0f, -2000.0f, 500.0f);
   glEnd();

   // front
   glBindTexture(GL_TEXTURE_2D, m_textures[1]);
   glBegin(GL_QUADS);
      glTexCoord2f(0.0f, 0.0f);
      glVertex3f(-2000.0f,2000.0f, 500.0f);
      glTexCoord2f(1.0f, 0.0f);
      glVertex3f(2000.0f, 2000.0f, 500.0f);
      glTexCoord2f(1.0f, 1.0f);
      glVertex3f(2000.0f, 2000.0f, -500.0f);
      glTexCoord2f(0.0f, 1.0f);
      glVertex3f(-2000.0f, 2000.0f, -500.0f);
   glEnd();
 
   // and so on ...
} 
Any clues? I''m guessing it''s just some option I''ve forgotten, but who knows, admittedly its been a good month since I''ve touched GL. - Ben

Share this post


Link to post
Share on other sites
Advertisement
When you create your texture for the skybox, try this:

glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);


----------------
Amusing quote deleted at request of owner

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!