Jump to content
  • Advertisement
Sign in to follow this  
Heretus

OpenGL texture mapping issue

This topic is 3131 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

Hi folks, I'm having some trouble tracking down a texturing issue. It's been a while since I've worked with OpenGL so forgive me if this has an obvious fix. This image demonstrates my issue: As you can see, the edges of quads are seems to be grabbing texels from the opposite edge of the texture. Initially I assumed my texture coords were somehow wrong, but after extensive checking I'm pretty sure they are correct. I tried using glTexParameter() with GL_CLAMP, various filtering options, and different textures with the same result. Also glGetError() shows no errors at any point. I'm about to start banging my head on the keyboard so any help would be appreciated

Share this post


Link to post
Share on other sites
Advertisement
I tried that also, same result.

Also tried using using GLuints instead of GLfloat for the texture coords, just to be sure.

Share this post


Link to post
Share on other sites
Ok, so as it turns out GL_CLAMP_TO_EDGE works but I was using it incorrectly.

That leads me to another question however. If I wanted to double the length of the cube without texture stretching, I'd need to render additional quads?

Share this post


Link to post
Share on other sites
Quote:
Original post by Heretus
That leads me to another question however. If I wanted to double the length of the cube without texture stretching, I'd need to render additional quads?
Pretty much, yes. You can however do some tricks with texture borders, but I am not sure how well this meshes with modern hardware.

Share this post


Link to post
Share on other sites
Quote:
If I wanted to double the length of the cube without texture stretching, I'd need to render additional quads?
You can always do things like "glTexCoord2f(2.0,2.0)" to tile the texture twice over a cube with sides twice as long. Note that you can't use clamp in that case, though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!