PDA

View Full Version : rim with textures lower than current viewport



lobbel
07-12-2010, 03:55 PM
Hello,
let's assume I have a current viewport set (glViewport(...))
with 1200x800 and a texture has the same size. Then I have no
rim at the border of the texture. You can see this at the picture
http://img251.imageshack.us/img251/9052/riml.jpg
On the top image u can see there is no rim. the rexture is as large as the current viewport. The bottom image shows a texture that is below the current viewport. Why do I have those rims ? The smaller the texture is, with respect to the current viewport, the greater gets the rim.

regards,
lobbel

overlay
07-12-2010, 05:52 PM
Try GL_CLAMP_TO_EDGE. For example:

glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_EDGE );

This is core in OpenGL since OpenGL 1.2. Otherwise it is provided by extension GL_EXT_texture_edge_clamp or extension GL_SGIS_texture_edge_clamp.

lobbel
07-12-2010, 06:39 PM
Thanks,
GL_CLAMP_TO_EDGE solved the problem.

regards,
lobbel