Closed jdolan closed 4 years ago
I've heard that UBOs are reasonably expensive to update often, so it may be beneficial to batch all the materials into a single UBO containing a material array, which would move materials from per-drawcall uniforms to batched/updated once per frame. Texture samplers would still have to be bound per-drawcall, but this still may result in a net performance gain.
This is now implemented.
r_material.c
in thebrave-new-world
branch is basically commented out. It needs to be reimplemented to work in the new renderer model. Features that were not used, or that did not work well, should be dropped. A separate program should be created for rendering material stages. It should have its own vertex attribute struct, etc. It may be desirable to use a uniform block for material attributes? That could allow us to perform most stage animations on the GPU. Or not.. this all needs to be weighed and thought through.