enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows

Home Page:http://www.limonengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SetVisibilityAndPutToSets is doing redudant work

enginmanap opened this issue · 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.

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

this is fixed