Jump to content
  • Advertisement
Sign in to follow this  
parrow

Repeat texture problem, help

This topic is 2529 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!