Changing between textures in a triangle list.

Started by
2 comments, last by MasterWorks 16 years, 8 months ago
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!
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.
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
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.

This topic is closed to new replies.

Advertisement