PDA

View Full Version : seams in cubemap texture?



polyglot
11-22-2005, 02:36 PM
Hi,

I'm using a cubemap for reflections and recycling it for use as a skybox. I draw a screen-aligned quad with the appropriate (camera-dependent) texture coords and it renders my skybox nicely.... except that there are seams in it along the joints between each cube face.

I also get the same seams in my reflections using the same cubemap. The seams are 1 fragment wide, regardless of the screen or cubemap res, so I'm sure I haven't broken my textures.

What am I doing wrong? Clamp/wrap?

I'm running an ATI 9600Pro in linux, fglrx 8.19.10 if that makes any difference. I can post a screengrab tonight if people want.

11-22-2005, 07:49 PM
Play with the wrap modes. I've found GL_CLAMP_TO_EDGE works quite nicely with cubemaps. :)

Edge clamping can help by shrinking the texture sampling rect by 1/2 texel in all directions, so that when two faces of a cube meet at an edge, they'll each contribute 1/2 to a shared texel rather than duplicate a common border.

polyglot
11-22-2005, 10:28 PM
works beautifully, thanks!

11-23-2005, 12:49 PM
:cool:

11-23-2005, 03:58 PM
GL_CLAMP_TO_EDGE is not bad but still not perfect.

C'mmon, go for the Right Stuff and use texture borders, the only perfect solution.