PDA

View Full Version : Black borders around clamped textures



Ketracel White
05-25-2004, 09:02 AM
This is a little puzzling:

I have written an application that has to render textures with GL_TEXTURE_WRAP_S set to GL_CLAMP. This looks fine on my system with Windows 98 and a Geforce 3Ti 200 (Driver version 23.11.)

However, on the same computer with the same graphics card running Windows XP (driver version 56.72) I am getting ugly black borders around the same textures making the program totally unusable.

How is something like this even possible and more importantly, is there a way to get rid of it?

ZbuffeR
05-25-2004, 09:31 AM
The black borders is a feature of GL_CLAMP mode. Really.

Some people mess with borders so it can be useful, but NVidia decided to add a driver switch to change GL_CLAMP into GL_CLAMP_TO_EDGE. It is called something like "Enable conformant OpenGL texture clamp behaviour" and needs to be enabled to be OpenGL conformant (obviously) but it is disabled by default.

I don't remenber when the switch appeared, maybe on older drivers it was always off ?

So check the little box, you should see borders on your nVidia, then use GL_CLAMP_TO_EDGE in your program to get rid of them.

Have fun !

Edit : maybe a driver update from 23.xx to 60.xx can be nice.

Ketracel White
05-25-2004, 11:26 AM
Thanks! That helped.

Jared
05-25-2004, 09:50 PM
Originally posted by ZbuffeR:
Some people mess with borders so it can be useful, but NVidia decided to add a driver switch to change GL_CLAMP into GL_CLAMP_TO_EDGE.wasnt that the other way round? clamp was supposed to work like clamp_to_border, but nvidia decided the other way is more useful? in the end there was chaos and so they added a switch to change it to behave correctly.

anyway: just stay away from clamp and explicitly clamp to edge or border to avoid any confusion.