1
votes

My question pertains to the best way to handle multiple textures. First some context:

I'm using DirectX-11 in a non-gaming application; the gui uses DirectX exclusively. I'm in the process of making the gui skinnable, so the user can customize the gui to their liking.

I've written the code in such a way that the gui layout and the size of each gui element can change based on a configuration file. The gui currently uses only DirectX primatives via DrawIndexedInstanced, but I'd like to support user supplied textures. The size of these textures can vary. There can be as many as two dozen of these different textures.

I can solve this problem by either:

  1. Dynamically putting together a texture atlas, or...
  2. Forcing all of the textures into a 2d texture array (by making all of the textures the same size via padding as needed), or ...
  3. Splitting up the DrawIndexedInstanced calls so that there's one draw call for each of the different textures (i.e. multiple binds / draws).

I spent the afternoon looking for consensus. I didn't find it. Penny for your thoughts?

1

1 Answers

0
votes

The approach that runs fastest is the texture atlas. This is why 2d games use sprite maps. Multiple binds / draws is the slowest approach.