PDA

View Full Version : Texture Atlas Problem



bobGL
05-03-2008, 06:42 PM
Is there any way that I can achieve tiles using a texture atlas? I can't figure out how to (ie) be capable to tile a texture that is in the middle of the atlas...

Tks in advance for the tip!

Cheers!

-NiCo-
05-04-2008, 12:13 AM
If you're using shaders you could first apply a linear transformation that maps the rectangle in your texture atlas to the [0,1]x[0,1] range and take the fractional value of the result. After that, apply the inverse transformation to the result. Finally, use the resulting value for your texture lookups.

bobGL
05-05-2008, 03:52 PM
Hummm, I see, but without shaders is there a way?

Im exploring this technique in order to apply it on a mobile device app, no shaders are available and well on 2 texture channel can be used... any suggestions?

Cheers!

arekkusu
05-05-2008, 04:03 PM
No. You can't wrap texture coordinates to arbitrary subrectangles.