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: Question about texture mapping

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    5

    Question about texture mapping

    Hello,

    I have a question about texture mapping in my program.
    I was able to implement Projective Texture mapping correctly in which I load an image and use that as a texture for projection.
    The question is that depending on where my camera is or in other words when the texture is out of range [0,1], the texture repeats.
    In order to handle this, I used glTexParameteri with GL_CLAMP on both s and t. It seems working but now, another question is that it will look something similar to this:

    I want my texture to show only the lower left without having those vertical or horizontal stripes...
    So something like this:

    So I am using GLSL to compute projective texture coordinate and use texture2DProj to draw it.
    Is there anyway I can do this? Could someone help me on this?

    Thank you so much!

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    17

    Re: Question about texture mapping

    Maybe you can manually set all texels in the border of the texture to black?
    Or set them with max transparency.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    178

    Re: Question about texture mapping

    Set the clamp mode to GL_CLAMP_TO_BORDER instead and specify a black border color.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    5

    Re: Question about texture mapping

    Thank you so much! That's what I wanted it and it worked perfectly!

Posting Permissions

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