Jump to content
  • Advertisement
Sign in to follow this  
Kitasia

Changing between textures in a triangle list.

This topic is 4163 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 don't mind the overhead, I was just wondering if there was a way change textures inside a triangle list. Seems like using a triangle list can really hinder you if you're drawing triangles with a bit of different features to them. I'm switching between 40 or 50 small textures or so. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Scratch that, I did some reseach and there looks to be nothing. I'm guessing it's only usable with an atlas. Meh, I've got a lot of reorganization to do.

Share this post


Link to post
Share on other sites
Hi AntiGuy,

You could access multiple textures through your pixel shader if you can idenfity somehow which texture to use for each triangle?

From what I've understood you can access upto 8 textures this way, although I can't say I've ever tried this.

Marco

Share this post


Link to post
Share on other sites
Quote:
Original post by AntiGuy
Scratch that, I did some reseach and there looks to be nothing. I'm guessing it's only usable with an atlas. Meh, I've got a lot of reorganization to do.

Texture switching is an expensive (and in my case, very common) reason to break a batch. It has to be done occasionally of course, but 40-50 small textures is bad. You'll get tremendous performance gains by putting them into a larger texture and thus rendering more triangles per draw call. I used to do it your way for a 2D engine and it's way to expensive, especially on lower end GPUs. With a large texture you can easily manipulate the texture coordinates (instead of the texture) for animation.

My recommendation is that you write a tool or two to help you with managing sprites and/or combining smaller images into a larger one.

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!