Anyone using Bullet serialization?

Started by
4 comments, last by Ed Welch 8 years, 6 months ago

I found that creating a scene with btBvhTriangleMeshShapes is quite slow, so according to the bullet wiki you can speed that up by serializing the bullet data to disk and then loading back again. However, looking into the serialization code I realize there are a number of issues with it. First off, it's creating a 32k file for one single mesh of 100 vertices - that's means the whole scene is going to be massive. Also, I heard that you can't serialize individual shapes, you only can serialize an entire world.

I'm just wondering if anyone has actually used that part of bullet and is it stable.

Advertisement

You've probably seen this :

http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization

But in general the serialization stuff isn't really that useful apart from helping to debug bullet issues.... You can serialize individual objects, but it's one of these things that snow balls, so a rigid body needs a collision shape, which may then need to serialize the accelerator like the trees for BvhTriangleMesh and so on.

I think the 32k issue you've got above may not be a problem though. The serializer works in chunks so that's probably just the default chunk size, you could add a lot more and have it fit inside that same chunk.

I only need it to speed up the creation of the btBvhTriangleMeshShapes (It takes about 2 minutes to load an entire scene). But I'm thinking now that it's more effort than it's worth.

Looks like the TuxKart team tried something similar (though they seem to have backed it out) :

https://github.com/supertuxkart/stk-code/commit/06d9359fa6bcbd4ef53d763194815edcd8e4637e

out of interest how big are the meshes that are causing such slow building of the meshshape - are they all around 100 tris and it's just the sheer quantity of them?

Take a look at this. Bullet typically recommends against serializing the world. Probably because it is faster to recreate data than it is to load in data, do pointer patching, etc.

http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization

Looks like the TuxKart team tried something similar (though they seem to have backed it out) :

https://github.com/supertuxkart/stk-code/commit/06d9359fa6bcbd4ef53d763194815edcd8e4637e

out of interest how big are the meshes that are causing such slow building of the meshshape - are they all around 100 tris and it's just the sheer quantity of them?

That's interesting. I wonder why they removed the serialization.

It's a mixed bunch of meshes, probably altogether 120k triangles. The speed depends on the CPU. On a Cortex A9 it's slow.

This topic is closed to new replies.

Advertisement