limonEngine icon indicating copy to clipboard operation
limonEngine copied to clipboard

SetVisibilityAndPutToSets is doing redudant work

Open enginmanap opened this issue 3 years ago • 1 comments

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 avatar Jul 02 '22 23:07 enginmanap

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

enginmanap avatar Jul 11 '22 20:07 enginmanap