Page 1 of 1

OnPostRender slow, manageing thousands of Scenenodes...

Posted: Mon Aug 09, 2004 8:12 am
by eis_os
Hi

Currently with my octree culling scenenode I manage to have 90000 Objects without a lockup ~4fps and display ~ 200 triangles that are in the frustum.

The really big problem I have it's the rather slow OnPostRender function. Currently the analyse shows it's 53% the time of running in it. Overloading it with a dummy function results in a framerate of 85fps with ~ 200 triangles My question is how to workaround the problem, the functions always calcs every frame the updateAbsolutePosition :(

Posted: Thu Aug 12, 2004 12:07 pm
by Electron
I think it should be easily possible to change that so updateAbsolutePosition is only called for a node when setPosition() or setRotation() are used on it. Since few nodes will move every frame that should yield a speed increase. Only potential pitfall is if a node has two movement animators on it, thus it updateAbsolutePosition would be called twice per frame. That situation is fairly unlikely though, at least I can't think of when it would be likely to be used.
Another solution, which would help the last unlikely sceneario would be to set a flag on the node when it's transformation changed. OnPostRender would call updateAbsiolutePosition only of the flag was set true, then would clear the flag regardless

Posted: Fri Aug 13, 2004 10:24 pm
by Captain_Kill
Nice :D :D :D Will try that flag idea Electron... I think you're right with that too so i'll give it a shot and see what happens.