Jump to content
  • Advertisement
Sign in to follow this  
youshotwhointhewhat

OpenGL Border texture coords with linear interpolation

This topic is 4042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I understand that if I have borders enabled, a texture coord of 0.0 will give me the interpolated value half way between the border color and the first texel. If I have the coords set to REPEAT without borders, then a texture coord of 0.0 will give me the interpolated value half way between the first and last texel. If I have borders disabled and the coords set to CLAMP, I know that a texture coord of 0.0 will give me the value of the first texel. My question is: is openGL interpolating half way between the value of the first texel and itself (ie. a texture coordinate that is half a texel in will also return the value of the first texel), or does openGL 'shift' the texture coordinates over (ie. a texture coordinate that is half a texel in will give me the value interpolated half way between the first and second texel). Hope my question makes sense.

Share this post


Link to post
Share on other sites
Advertisement
no idea, yould best look in the spec which can be gotten from www.opengl.org

Share this post


Link to post
Share on other sites
You cannot disable the texture border. It's always there, and always in use. How did you "verify" that "disabling" the border gives you the first texel's color value with a texture coordinate of 0?

Only way I can think of getting that result is by setting clamp mode to CLAMP_TO_EDGE which clamps the texture coordinates to the range [0.5/N, 1-0.5/N] instead of [0, 1], thereby clamping the coordinate to the center of the first texel where the texels color is defined.

Share this post


Link to post
Share on other sites
Quote:
Original post by Brother Bob
You cannot disable the texture border. It's always there, and always in use. How did you "verify" that "disabling" the border gives you the first texel's color value with a texture coordinate of 0?

Only way I can think of getting that result is by setting clamp mode to CLAMP_TO_EDGE which clamps the texture coordinates to the range [0.5/N, 1-0.5/N] instead of [0, 1], thereby clamping the coordinate to the center of the first texel where the texels color is defined.


You are correct. I wrote a little test script. "Disabling" borders is equivalent of having the border color set to black.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!