Restrict texture sampling region?

Started by
0 comments, last by jollyjeffers 16 years, 1 month ago
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?
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement