Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture borders

Started by Whitman Nov 13, 2004 at 9:42 AM 6 replies 950+ views
Original Post
Whitman
Whitman
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.
Whitman
Whitman
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.
crazy_andy
crazy_andy
Maybe try some blending.
www.stickskate.com -> check it out, some gnarly stick skating movies
s_p_oneil
s_p_oneil
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.
dawidjoubert
dawidjoubert
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
----------------------------http://djoubert.co.uk
s_p_oneil
s_p_oneil
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.
Whitman
Whitman
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.