A long time ago, I saw people said "Batching render can improve a lot of performance."
But I couldn't find a method to batch render with a lot of textures. But I found texture atlas, which is a trick that put all the textures into a big texture and put mapping data in a big vertex buffer. So now I can do batching render with a lot of textures. But I found that Microsoft said "
Keep the textures small. The smaller the textures are, the better chance they have of being maintained in the main CPU's secondary cache.
Do not change the textures on a per-primitive basis. Try to keep polygons grouped in order of the textures they use. " today.
Well, obviously, a texture atlas have a huge size.
Microsoft also said "To get the best rendering performance during execution, try to work with primitives in batches and keep the number of render-state changes as low as possible. For example, if you have an object with two textures, group the triangles that use the first texture and follow them with the necessary render state to change the texture. Then group all the triangles that use the second texture."
So does it mean that I should draw texture one by one rather than batching a texture atlas? Did anybody do any experiment about this?
Also, Nvidia said "
The most straightforward way to render, say, two textured quads is to bind the
reduce batch-count from two to one."
That is so confusing!!!
Help!
Thanks~~~
Reference: Microsoft: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147263(v=vs.85).aspx
Nvidia: http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf