PDA

View Full Version : Tiling textures with integer UV's.



Steven Haggerty
07-09-2004, 07:47 AM
Hi all,
This is kind of a follow-up to a post about byte sized verts. I'd like to know if its possible to tile a texture using (for example) 8 bit texture co-ordinates. For example if I had a 256x256 texture I'd like to wrap 4x in U and 4x in V I would normally set the coordinates to 0.0f,0.0f -> 4.0f, 4.0f (in float) how would I do the same with 8 or 16 bit integer texture co-ordinates? Am I going to have to do it using the texture matrices, like I have done for 8/16 bit positional verts (using a scale matrix).

PS:Some examples utilising these kind of extensions would be useful (to go with the single triangle one :( )

Thanks,

Steve.

hmwill
07-09-2004, 10:04 AM
You simply multiply the two scaling factors, e.g. you scale by 4/255.

- HM

Steven Haggerty
07-09-2004, 11:22 AM
Using the TextureMatrix right?

Thanks,

Steve.

hmwill
07-09-2004, 06:02 PM
Yep.