How would I tile a texture on an object?
Printable View
How would I tile a texture on an object?
use numbers bigger than 1.0 for your texture coordinates
...
ie
2.0 would tile the texture twice.
Do modulo math or use AND for powers of 2 - which all your textures should be.
u&= (TextureSizeX-1);
v&= (TextureSizeY-1);
or
u%=(TextureSizeX);
v%=(TextureSizeY);
Of course u and v must be integers to use this.
For DirectX, though, the SDK says to use values over 1.0 to tile the texture. My first post was for a different texturing scheme.