   Draw mesh with many textures by one draw call
  Hi,In my engine I use sorting for meshes with more than one diffuse texture, so 1 texture = 1 submesh (vertices group assigned to texture), eg:Mesh has got two diffuse textures, first on head and second for body, so my mesh has got 2 submeshes and when I render it I:* set first texture (head)* draw vertices which usage this texture, so I draw only head part (this is first hardware buffer)* set second texture (body)* draw vertices which usage this texture, so I draw only body part (this is second hardware buffer)How can I optimize it? In current solution I have to use 2 draw calls, so if object has got many texture FPS go down... Can I draw it by one draw call? How?Thanks for help,   
  There are two answers:1.) You can't2.) You can but you have to combine the textures:---- Put them on the same texture, adjust texture coordinates---- Use a 3D texture with 1 layer for head, 1 layer for bodyDrawcalls are your enemy and in cases like this you can't get away from them.The only solution is to have your artist get clever and stop using so many dern unique textures. Merge the textures together, make an atlas, or make a bunch of draw calls, those are really the only options.One optimization you should already be making is sorting by material:Psuedo:Set head_texture;Draw player1_head;Draw player2_head;Draw player3_head;Set body_texture;Draw player1_body;Draw player2_body;Draw player3_body;Better Pseudo:foreach (Material m in MaterialsInUse){  SetMaterial(m);  foreach (Submesh s in MeshesThatUse[m])  {    DrawSubmesh(s);  }};  Texture atlases are the traditional way to deal with this, but those do bring about their own issues.If you're fortunate enough to be using D3D10, you can use texture arrays for this sort of thing.   