Sign in to follow this  
Ed Welch

Anyone using Bullet serialization?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this