Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Material property changes don't work with ObiCloth
#3
(02-11-2021, 08:09 AM)josemendez Wrote: Hi Tim!

The reason for this is that Obi uses the list of shared materials in the renderer to render the cloth itself, since SkinnedMeshRenderer does not allow certain features needed for cloth rendering. Go to line 69 of ObiSkinnedClothRenderer.cs, and change:

Code:
skin.GetSharedMaterials(rendererMaterials);

to

Code:
skin.GetMaterials(rendererMaterials);

That should do it.

Thanks! Is this something that will be officially supported by ObiCloth in the future (either by default, or via a toggle on the ObiSkinnedClothRenderer)?

*Edit: this seems to be a partial fix for the issue, but I'm not actually getting bloody-gown action yet. The instanced material property is getting updated as we'd expect, but it looks like the property changes are not actually being written to the GPU. At runtime, the gown remains un-bloodied. I can "fix" this by opening the gown's material inspector at runtime and changing any property inside it, which triggers (presumably) an upload of all properties to the GPU.

We're modifying the material property via a simple Unity animation that looks like this:

   

The Body mesh's "_Stain Amount" property is being sent the GPU. (This mesh does not use ObiCloth.) The Gown's two properties are not being updated. (Or rather: I can see the updated values in the inspector, but they don't result in any visual changes.)
Reply


Messages In This Thread
RE: Material property changes don't work with ObiCloth - by timconkling - 02-11-2021, 08:41 PM