Jump to content
  • Advertisement
Sign in to follow this  
Whitman

Texture borders

This topic is 5061 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, I've made a big cube consisting of 6 planes to act as a skymap in my application. I've mapped a different texture to each plane but unfortunately you can see lines where the planes join. You can see what I mean at http://users.cs.cf.ac.uk/A.R.Whitman/skymap.jpg The lines can be seen when using both GL_REPEAT and GL_CLAMP on the textures. Is there a relatively simple way of fixing this? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I had to define GL_CLAMP_TO_EDGE myself as 0x812f as I haven't got glext.h.
It's slightly better, the lines are less noticeable but they can still be seen.

Share this post


Link to post
Share on other sites
If you're not actually using the cube map extension, you will always have this problem. To my knowledge, the cube map extension is the only way to get the texel interpolation to flow smoothly from one face to another (i.e. where a texel from one face is interpolated with a texel on a neighboring face). GL_CLAMP_TO_EDGE will cause the interpolation to stop at the edge of each face, and those edges are always going to be visible.

You might be able to "fudge" it by making sure that each texture edge is identical to its neighboring edge. Then you can draw each face of the cube with a tiny bit of overlap (the distance of 1/2 a texel so that the center of the edge of one face meets the center of the edge of the neighboring face). In theory this should cause the interpolation to look smooth from one face to the next. I'm not sure exactly what will happen at the corners where 3 textures meet. Either way, it ought to look about as good as the cube map extension if you do it right.

Share this post


Link to post
Share on other sites
Yes that could work but only on corners that come in... eg if its a sharp corner u would see the triangles all go past one another.

Unless im missing u.

Y dont u ask ut2004 developers, im sure they'l help.

lol

Share this post


Link to post
Share on other sites
You won't see the corners go past each other unless it's partially transparent. This one isn't, so the corners can be sharp and you won't see it. The only question is how it will look to have 3 parts of the same texel stretched in different directions. The cube map extension has to deal with the same thing, but it may have special code there to compensate.

Share this post


Link to post
Share on other sites
Thanks for the replies.
What I'm doing doesn't require this to be perfect so I think I'll leave it for this project, but I'll keep it in mind if I do something similar again.

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!