Skip to main content
GameDev.net gamedev.net
🔒 Locked

Repeat texture problem, help

Started by parrow Jan 10, 2012 at 6:27 AM 1 replies 1.1k views
Original Post
parrow
parrow
Hi everybody. I make a texture file in my work:
[attachment=6656:1.jpg]
when i use this and get the wrong result here...
[attachment=6657:2.jpg]
i just want the texture repeat with grid "1"
how can i do? please give me a hand, many thanks
kauna
kauna
Can you show some code?

Tiling such a texture has some problems.

It seems that your texture (for example u-) coordinates are in between 0 and 1/4, then back to 0 (in a small range it results the reversed number on 1 ).

You could write a pixel shader where you use fmod on the texture coordinates like :

uv = fmod(uv,float2(0.25f,0.25f));

This allows you to use a regular texture coordinates and the modulus will keep the texture coordinates in the desired range.

Cheers!
parrow
parrow
Thank u kauna. As you say, it's a wrong coordinate between 0.25 to 0, Cheers!biggrin.png

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.