Jump to content
  • Advertisement
Sign in to follow this  
fig

GLSL texture tiling

This topic is 4253 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

I have 4 smaller textures packed onto a larger texture..
    0       0.5     1
  0 -----------------
    |       |       |
    | tex1  | tex2  |
    |       |       |
0.5 -----------------
    |       |       |
    | tex3  | tex4  |
    |       |       |
  1 -----------------

What I need is a formula that'll take a texture coordinate and tile it, keeping the result within the desired range.. If it was one texture (range 0..1) it would simply be something like tc = fract(tc) But I can't figure out how to scale it to the correct range with multiple textures. For example. I want to use tex2 and tile it across a terrain. Thanks for any help. fig

Share this post


Link to post
Share on other sites
Advertisement
I think it's not a good idea for performance. In the fs, you need to fiddle with each texcoord. Very bad idea.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!