Jump to content
  • Advertisement
Sign in to follow this  
aloknarula

clamp UV

This topic is 4911 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

Advertisement
It clamps texture coordinats (sometimes called u and v) to [0,1] range.
A few examples for 2D coordinats:

(1.0,4.1) => (1.0,1.0)
(-0.2,0.4) => (0.0,0.4)
(-0.2,2.3) => (0.0,0.0)

Share this post


Link to post
Share on other sites
If you're thinking of Clamp UV as in a rendering state setting, it might be better to think of clamping as controlling how the texture color (texel) is looked up, rather than modifying the coordinates.

Clamping texture modes cause the pixels at the edge of the texture to be used when the texture coordinates "run off the edge". So if you are drawing something with a texture that has green at the right edge, and you use texture coordinates with U > 1, the color that will be used will be green no matter what U or V is (as long as U > 1).

There are other modes like tile, reflect, and border color, but clamp and tile (which wraps around to the other edge of the texture) are most common.

Of course you could be talking about a 3d program which actually modifies the UV coordinates also; what I said above just applies to 3d APIs like GL and D3D.

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!