I've almost finished the part on static objects.
I must make an improvement on the bouding boxes(I've just seen a bug today), and correct a memory leak.
I've not located where the memory leak is, I'm working on it, but if you find something, say it to me please
Basically, if you create a batch, destroy it, and recreate a batch, you'll have a loss of fps, and the memory usage of the process increased by 1.4 mo.
The new demo &source&new shader is here
I've just started to work on this demo, so there are many bugs and things not working. But with it I've found many problemes that i resolved, and other one that I'm trying to resolve
+/- to add a mesh to the batch. Notice that if the instancing is used, you'll have 50 objects max for 1 batch, and after that, if you want to have 51 objects, it will create a new batch instance, so you'll have 100 objects displayed, and not 51.
If you use static geometry, it will be fine.
Page down/up to change the model. Notice that it still crashes with meshes that have a skeleton, that will be my next improvement.
F1 to use instancing.
F2 to use static
F3 to use independant rendering(not in the demo yet).
G: destroy the batch
H: recreate the batch
If you've a crash when you exit the demo after having destroyed a batch, but not recreated one, it is normal.
So, if you play with G/H, you'll see the fps decrease, and the memory usage increase.
I've made several debugs, but I didn't saw where the leak is.
And the updated uml diagram