-
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!
-
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.
-
Junior Member
Regular Contributor
Re: Question about texture mapping
Set the clamp mode to GL_CLAMP_TO_BORDER instead and specify a black border color.
-
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
-
Forum Rules