jdolan / quetoo

Quetoo ("Q2") is a free first person shooter based on id Tech2. GPL v2 license.
http://quetoo.org
204 stars 28 forks source link

Materials rendering #565

Closed jdolan closed 4 years ago

jdolan commented 4 years ago

r_material.c in the brave-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.

kaadmy commented 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.

jdolan commented 4 years ago

This is now implemented.