Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Black borders around clamped textures

  1. #1
    Intern Contributor
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    59

    Black borders around clamped textures

    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?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Black borders around clamped textures

    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.

  3. #3
    Intern Contributor
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    59

    Re: Black borders around clamped textures

    Thanks! That helped.

  4. #4
    Intern Contributor
    Join Date
    Jan 2004
    Posts
    67

    Re: Black borders around clamped textures

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •