Jump to content
  • Advertisement
Sign in to follow this  
TheSilverHammer

How do you get wrapped textures when using textels?

This topic is 4011 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 know UV wrapping on a polygon is can happen when the UV range is over or under 0 or 1. However, what if you have a texture page that has a bunch of smaller textures you are using? IE: I have a 256x256 map full of smaller textures, on that page I have a brick that is 32x32. Lets say its UV's are 0.2 to 0.25. If I want to make a long quad that is 'tiled' with 10 bricks, I have no idea how to do that. Just making the quad 320x32 (lets say there is a 1:1 pixel to length ratio) will just make one brick that is streched out in the X direction. If this were just a single texture instead of a textel, I could just set my U to 0.0 to 9.0 and I would have 10 bricks. I do not know how to do that with textels.

Share this post


Link to post
Share on other sites
Advertisement
Hi,

with a texture containing several (tile) textures in it, you cannot take advantage of texture wrapping / mirroring. There is possibly a way with some pixel shader magic, but I wouldn't bother with that.

I would just draw a separate quad for each tile. You won't loose any performace with that. On the other hand you wouldn't gain any performance with texture wrapping either.

Just make sure that you don't draw each tile individually. Fill a buffer with the separate tiles (vertices and indices) and draw them with one draw call.

Good luck!

[edit] I just re-read your mail and figured that you may not be making a tile engine :D. If that is the case, the you could study some Carmack megatextures, but they are quite advanced stuff. So, inside one texture you can pack stuff that don't need tiling, otherwise you'll probably need a separate texture.

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!