I’ve coded a skybox class to draw a box with 6 textures on each quad to represent the sky. The method works perfectly, but I can see the joint between each quads. I checked the zbuffer, but the near plane is at 0.1f and the far at 1000.0f so I don’t think this is the problem, I also tried to change the filtering of the textures and disactivated the mipmapping but I sill not solve the problem. When I set the camera very near the joint, I can see a gradation at the border of the texture, why? There is no hole, as I use 8 vertices for all the box quads, and I can’t see the background color … I need help please, I really don’t know where does it comes from.
I think if you search the message board in either beginner or advanced, you’ll find the answer because I remember someone else having this problem. I think it had something to do with having to set the border settings for your polygons to something… I don’t recall…
oups, I think that I found it, now it works when I use GL_NEAREST filter. Do I have to use this filter to not have the gradation in the borner of my texture or is there any other solution with a filter as GL_NEAREST?
Punchey : I switch between GL_CLAMP and GL_REPEAT, this is only change the colour of the gradation (turning into black with GL_CLAMP).
instead of using 0 and 1 for the textur coordinates, use 1/width and (width-1)/width, so you stretch the texture at the edges out one pixel, and you dont have the “wrong” interpolation out…
Tanks for your answer, Matt, I read that the GL_CLAMP_TO_EDGE is only available with a OpenGL 1.2 compatible card or I’ve got a ATI 128 and this symbol isn’t included in gl.h ou glu.h, can I upgrade something? or is there a extension? Dave, I gonna check this out, this evening, a little rough method I think but interesting if I can’t do in a other way.
Yes, there is an extension, EXT_texture_edge_clamp.
Funny thing about it though is that in the documentation, it defines a new constant, GL_CLAMP_TO_EDGE_EXT, that can be used with the texture wrap modes.
However, in the glext.h file I got from nVidia, the GL_CLAMP_TO_EDGE constant from OGL 1.2 is defined, but the one with the _EXT isn’t.
Anyway, they are the same value, so you can use either one.
One more question, I can’t find the GL_EXT_texture_edge_clamp extension on the registry (http://oss.sgi.com/projects/ogl-sample/registry/) whereas I know my card supports this extension, do I have to use this extension as the GL_SGIS_texture_edge_clamp or is there any documentation for this extension (somewhere else that www.sgi.com)) ?
Strangely enough, the EXT_texture_edge_clamp extension does not exist. Only the SGIS version is a real extension. Somehow, though, by enough people putting the EXT in their extension string (we weren’t the first; we did it for compatibility), it seems to have become a widely accepted extension.