Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access the SkinnedMeshRenderer behind ObiSoftbodySkinner?
#2
(05-04-2024, 05:42 PM)kodra Wrote: As far as I can tell, once a ObiSoftbodySkinner is bound to a SkinnedMeshRenderer, the mesh is still rendered even I disable the SkinnedMeshRenderer at runtime. So I assume the ObiSoftbodySkinner "takes it over" at runtime and the SkinnedMeshRenderer is no longer in use. (plz correct me if it's not how it works)

In few words, yes that’s how it works, except for one important difference: Obi will batch together multiple softbody skinned meshes by combining them, in order to be able to deform a lot of geometry efficiently in parallel. Deforming each individual mesh in the main thread is just not an option, specially not when performing simulation in the GPU.

So there’s not a single “internal SkinnedMeshRenderer” per ObiSoftbodySkinner, but just a few of them for all ObiSoftbodySkinners.

Quote:However, there are some operations that we usually can only access through the SkinnedMeshRenderer. For example, changing the blendshape weights, switching the material, etc.

Blendshapes are not supported. Never have been and probably never will due to how softbody deformation clashes with pose-driven deformation: blendshapes change the rest shape of the base mesh which would require re-generating the blueprint every time a blendshape weight changes, something that cannot be done in realtime.

Quote:How do we do these in the case where ObiSoftbodySkinner presents?

Modifying the SkinnedMeshRenderer parameters (material, shadow casting options, etc) and then marking softbody rendering as dirty in the ObiSolver component. This will trigger a re-batching of softbody mesh data (merging multiiple meshes together, see above) which is mildy expensive, so it’s not recommended to do this every frame.

I’ll whip up an example of this for you on Monday.

Cheers!
Reply


Messages In This Thread
RE: How to access the SkinnedMeshRenderer behind ObiSoftbodySkinner? - by josemendez - 05-04-2024, 08:24 PM