giovedì 18 giugno 2015

Day 6: Complete Instancing

Today i completed the batching/instancing system.
Now each batch contains all those models with the same texture and the same mesh.

In the picture below I rendered 50 cubes and 50 spheres, using two different textures, and the total draw calls count is 4.
If I had used the metal texture only for the cubes, and the wood texture only for the spheres, the count would be 2.

I also wrote a MeshManager class.
Instead of giving a mesh to each model, i just give them an id, and they can retrieve the mesh from the MeshManager class with this id.
This was necessary in order to implement the batching system.


Nessun commento:

Posta un commento