On GitHub: https://github.com/wraitii/0ad/tree/instancingThis uses GL_ARB_draw_instanced ([[ https://feedback.wildfiregames.com/results/ | support > 98.8% ]]) to render some models using instancing instead of individual draw calls.
This uses GL_ARB_draw_instanced to render some models using instancing instead of individual draw calls.
ISSUES:
- Limited instancing of animated models (most unit meshes...).Essentially, Tthis could be fixed with more extensions.increases the bandwidth slightly when drawing, For now,since only one draw call is sent for many units. I think it instances trireme oars OK since those are animated in perfect sync.
TODO:This is dependent on the rendering being somewhat GPU-bound, since logically the CPU has to loop faster than the GPU would render the sent commands.
- Separate the renderer-only changes from the instancing changesThere is also a bandwidth factor in the matrices that are being sent, but overall I think this is _mostly_ a win.
Good stuff to test:
- Gaul barracks.
- Sahydian buttes or whatever it's called.
- Combat demo huge (with gpuskinning=true)To actually speed things up substantially, we would need to not re-create the buffer every frame.
----
Personal profiling shows a 0-20% perf difference, depending on the map.