enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

SetVisibilityAndPutToSets is doing redudant work #141

Closed enginmanap closed 4 months ago

enginmanap commented 2 years ago

The method/s SetVisibilityAndPutToSets and setLightVisibilityAndPutToSets are used to generate sets of Model*, using frustum culling, or render distance of All Models.

The problem is, after that stage, we never actually need the Model, only its world object ID. after filling the sets in the play stage, on render stage, we are iterating over the sets, creating vectors of objectIDs. This is just wasted CPU time and memory bandwidth, also makes render setup code more complex then necessary.

Most likely the idea was Objects were not guaranteed to not repeat, but now we use WorldObjectID as key, and it is a map, so the guarantee is there.

enginmanap commented 2 years ago

Turns out we use one of the models to call render, which can be accessed by object map.

enginmanap commented 4 months ago

this is fixed