Ogre ManualObjects + Bullet Debug Drawer

Problems building or running the engine, queries about how to use features etc.
Post Reply
TombFan1996
Kobold
Posts: 29
Joined: Tue Apr 19, 2016 2:51 pm
x 1

Ogre ManualObjects + Bullet Debug Drawer

Post by TombFan1996 »

Hi,

Note: Before I start I presume there will be requests to go to 2.1 understandably, for now, I want to stick to 2.0.

I was wondering what the fastest method of getting the vertices into the ManualObject every frame would be when using Bullet's Debug drawer, I have a 24456 triangled model and without the ManualObject (that holds all of the vertices in Bullet's world) being enabled, it runs at perfectly well, however enabling the drawing of Bullet's collision world and as the image shows, I get 4 fps which is terrible.

Note: I do draw Normals, Wireframe and Constraints, but even disabling all but Wireframe does not really provide any noticable performance gains.

Image

As i understand it, when you call debugDrawWorld it feeds all of the vertices into the drawLine function (in my case), I have inherited the btIDebugDraw in our Collision Renderer class, so that's all fine. To start with I call:

Code: Select all

m_lines->begin(Ogre::RenderOperation::OT_LINE_LIST);	
m_lines->position(btVector3(0,0,0));
m_lines->end();
This creates the buffer, pushes some pointless data through allowing me to call beginUpdate with the index of 0, I call beginUpdate in a pre-update function before the drawLine function and then in the post-update function, i call m_lines->end(),

Code: Select all

void CollisionRenderer::drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)
{
	m_lines->position(from);
	m_lines->position(to);
}
I presume the method stated above creates just one batch instead of endless amounts while the application is running.

In terms of the direction to go, is it wise to look deeper into deriving my own class from MovableObject, but then is there something in particular that is bloating the ManualObject class or is it something on my end? I am happy to post more code, any help would be really appreciated.

Thanks :)
frostbyte
Orc Shaman
Posts: 737
Joined: Fri May 31, 2013 2:28 am
x 65

Re: Ogre ManualObjects + Bullet Debug Drawer

Post by frostbyte »

also suffer/ed from unworkable performance
is ogre's bulletDebugDrawer much slower then bullets native( opengl ) debug drawer( is ogre the bottleNeck ) ?
was thinking of just using bullet native debugDrawer( using ogres native render system calls ) but that would work only with opengl
i think most of the bottle-neck comes from btTriangleMesh
so you can probably just disable it in the debugDrawer somehow and replace it with a regular ogre mesh( created directly from the btTriangleMesh ) and a custom material( wireFrameMaterial )
be happy to hear if you manage to improve performance, good luck.
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..

coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
Post Reply