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 3 of 3

Thread: 1D Texture

  1. #1
    Intern Newbie
    Join Date
    Jul 2002
    Posts
    43

    1D Texture

    Hi
    I'm doing a kind of cartoon rendering. I use a 1D texture to store shade values. It looks working fine unless the single texture coordinate is 1.0; then every thing is messy.
    Shade values are random and changing as I move or resize the window. I'm rendering trinagles as smooth shaded and 1D textured.
    I tried to pass the 1.0 texcoord in a similar program, not mine, and I got the same distrubing results.
    Is it a driver problem? or is it a normal thing?
    Thanks.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: 1D Texture

    Maybe yuo have the wrap mode set to GL_REPEAT, so when sampling the texture coordinate 1.0, you get a sample from the other edge of the texture aswell (due to linear filterting). Try change the wrap mode to GL_CLAMP.
    Code :
    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: 1D Texture

    Bob's right. The texture wrapping may be causing this.
    Though, I'd rather recommend GL_CLAMP_TO_EDGE instead of GL_CLAMP.
    Almost all todays cards (if not all) support GL_CLAMP_TO_EDGE.

Posting Permissions

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