Currently I have a naive Mesh data structure to store wavefront files.

This data has 3 buffers for the vertices, normals and UVs. It works well to the point I can render the sponza scene, despite such a scene having multiple inner meshes.

The issue is, currently I can onlky render 1 "thing" (I can only have all the mesh associated to a single texture and material properties).

Since I want to be able to render the sponza scene properly (with all the textures), I need to associate with the vertices different textures and material properties. Based on the information of the associated mtl files.

What is the proper design to have a Mesh, transform and material objects wrapped in a containing structure such that you can handle complex geometry like the sponza scene?

  • 1
    $\begingroup$ The first place to start would be to batch geometry by materials/API state changes in order to minimise the number of render state changes required to render the whole scene. You may want to consider spatial subdivision on top of that so you can cull geometry thats not visible. $\endgroup$ – PaulHK Jul 5 '18 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.