InstancedMesh move on Surface SkinnedMesh

Hi everybody , i have a question, I have implemented Instanced mesh running on the model surface using volume + sdf texture. Now I intend to apply for skinnedMesh. I think I’m going to take advantage of three-bvh to render skinnedMesh low poly and export to sdf textures in real time and use them.
– Combine these two methods:
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/skinnedMesh.html
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/sdfGeneration.html
==> I want to ask, is this idea feasible?

** Another direction is to export sdf through frames of skinnedMesh with low resolution. And read them using sampleAs3DTexture. But it seems that this option takes a lot of space, and perhaps requires additional interpolation costs

Not sure about the performances, but it should work just like the skinedMesh example, the key is the StaticGeometryGenerator class.

// Create the static geometry holder
const staticGeometry = new THREE.BufferGeometry();

// Initiate the static geometry generator
const staticGeometryGenerator = new StaticGeometryGenerator( model );

// ... Update and step your SkinedMesh animation

// Regenerate the static geometry each frame (or when needed), 
// and use it as you  would with any geometry
staticGeometryGenerator.generate( staticGeometry );
2 Likes

Thanks for your feedback!

1 Like

That’s right, I tested it in realtime, and it’s too laggy. The last option is to use bvh to output static sdf, and read them later.

1 Like