Open MatthewsSam opened 5 years ago
After some tests, while the use of a linked list is a bit unexpected, that doesn't seem to be the root cause of the slowdown.
LODNode::OnAnimate appears to be a major source of slowdowns, I get a 15 FPS gain if I remove it.
... and if I totally remove all calls to OnAnimate, I gain another 15 FPS (total 30 FPS gained by removing those calls!)
So after some tests with a profiler:
Early prototype of possible improvement pushed to branch "3780-scene-optimisation"
So after trying your branch + auto LoD on amazon the track Black Forest I got: 75 FPS with the current master 85 FPS with the prototype branch 91 FPS with auto LoD
according to https://github.com/supertuxkart/stk-code/issues/3805#issuecomment-1228006247 it should be faster now
Testing the Lodtest track while making everything invisible by returning automatically "-1" (don't display) when checking the LoD level.
Compiled in STKRelease mode, using OpenGL.
1.0 : ~100FPS Master with the invisible objects : ~230FPS Master with the objects removed through the "very low" setting : ~750FPS
While there is a very clear improvement, the perf cost of invisible objects is still way too high.
If we load 10 000 invisible objects in SuperTuxKart it will render the scene at 30 FPS (while it's 100 if there are no objects).
It's ridiculous to go down to 30 FPS for only 10 000 objects which are not even displayed.
After quick investigation it might be because currently ISceneNode uses CORE::LIST which is a linked list. Linked list are slow for quick iteration needed by the scene manager for the rendering.