ogre
ogre copied to clipboard
OgreBullet: debug drawing of btHeightfieldShape is extremely slow
Hi, all!. When using Ogre terrain and adding collider to it using btHeightfieldShape, if debug drawing enabled, on my laptop the FPS drop is from 3000 FPS unlocked to 3FPS. Which is quite strange as this never happens with Bullet demo. Otherwise (if debug drawing is disabled) the FPS drop is from 3000 to 2000 which is expected. Something needs to be fixed...
do you have a reproducer for this? (maybe with a PR to add btHeightfieldShape to OgreBullet ^^)
Will add as soon as I get to my workstation, around June 22-23. I have a code of course, but now I'm travelling :(
An yes, the PR is happenning too as I got how to integrate colliders and paged terrain.
Debugged that some more. It looks like the issue is due to large number of line draws when debugging runs for heightfields. I guess that is a shortcoming with constant updates of ManualObject. It is kind of usable with terrain size of 129, but becomes unusable with size of 513. Perhaps this can be solved by using several ManualObjects...
you could try moving this into the header and see whether it helps with performance:https://github.com/OGRECave/ogre/blob/8af1c8b7a329477f9adca39e92fe95cc66ecf190/Components/Bullet/src/OgreBullet.cpp#L776