Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
Currently frustum culling, when enabled, happens pretty late in the pipeline.
Meanwhile in the monolithic prepareModelForRender() there is a lot of stuff that is not needed if the model is culled away.
Thinking mainly of material and esp. the default/principled materials' built-in texture maps: loading the base color map for a model is wasteful if the model is then culled away, and the same texture map is not used by any other model in the scene.
Ideally prepareModel should be split up to multiple smaller functions, and the culling would happen at some point in-between those.