ogre icon indicating copy to clipboard operation
ogre copied to clipboard

OgreBullet: debug drawing of btHeightfieldShape is extremely slow

Open slapin opened this issue 5 months ago • 3 comments

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...

slapin avatar Jun 19 '25 09:06 slapin

do you have a reproducer for this? (maybe with a PR to add btHeightfieldShape to OgreBullet ^^)

paroj avatar Jun 19 '25 10:06 paroj

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 :(

slapin avatar Jun 19 '25 13:06 slapin

An yes, the PR is happenning too as I got how to integrate colliders and paged terrain.

slapin avatar Jun 19 '25 13:06 slapin

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...

slapin avatar Jun 24 '25 13:06 slapin

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

paroj avatar Jun 24 '25 13:06 paroj