Jump to content
  • Advertisement
Sign in to follow this  
freka586

Restrict texture sampling region?

This topic is 3798 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 am using a texture that has "tiled" content. Say for instance that the texture is 512x512 pixels, and that it contains a green, blue, yellow and red square, each 256x256 pixels. Now I want to restrict texturing so that only one portion of my tile-texture is being used. I.e. I only want to use the green (upper left) portion of my texture when texturing my primitives. For contents outside (in the >0.5 texture address space) I want it to be handled like when sampling outside of the physical texture. Is there a way to accomplish this (or similar), without manually changing the texture coordinates of the vertices?

Share this post


Link to post
Share on other sites
Advertisement
You can probably use the texture transform matrices to perform some basic remapping of TC's without actually modifying the data if thats what you mean.

Actually replacing/stopping colour from outside of a region isn't possible in the way you describe. Most hardware can do border colours, but that's outside of the [0..1] range and not outside of a particular TC range...

hth
Jack

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!