Sign in to follow this  
Heretus

OpenGL texture mapping issue

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this