Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Softbody High Particle Count Skinning Bug
#1
Hi, sorry to bother you again, I'm encountering a rather unreliable skinning behaviour.

   

Steps to reproduce:
When modifying the RubberDragon demo, if you increase the Surface and Volume Sampling to a 100, to increase the particle count. And re-binding it in the skinner with the default parameters. Removing custom skinmap doesn't help.
Increasing Radius in the Bind parameters helps the issue somewhat, but it "inflates" the skinned mesh, and is a workaround I'd like to avoid.

Thank you very much for your continuing support and development of this amazing plugin!
Reply
#2
(11 hours ago)Eritar Wrote: Hi, sorry to bother you again, I'm encountering a rather unreliable skinning behaviour.



Steps to reproduce:
When modifying the RubberDragon demo, if you increase the Surface and Volume Sampling to a 100, to increase the particle count. And re-binding it in the skinner with the default parameters.

Hi!

The default skinning parameters may not work in all cases. You may need to increase the radius (which is a simple euclidean distance between vertices and particles) so that it considers more particles when calculating skinning.

Vertices that are not skinned to any particle will remain at (0,0,0), which is what is shown in your screenshot.

(11 hours ago)Eritar Wrote: Removing custom skinmap doesn't help.

Removing the skinmap will entirely break skinning, so it won't help at all.

(11 hours ago)Eritar Wrote: Increasing Radius in the Bind parameters helps the issue somewhat, but it "inflates" the skinned mesh, and is a workaround I'd like to avoid.

Increasing bind radius should not inflate the mesh at all, it only affects how many particles are considered when calculating skin weights: larger radius = more particles considered. Would it be possible for you to share a screenshot of how this "inflation" looks?

kind regards,
Reply
#3
Hi!

Upon testing, could reproduce the issue in 7.0 and 7.1. Will get back to you with a solution soon.

kind regards,
Reply
#4
Thanks for reporting this issue!

Found the culprit: skin, blueprints and softbody transforms have different scales, and there's a bug that affects the skinning process, shifting particle distances by an incorrect scale.

To fix it, open up ObiSoftbodySkinner.cs, around line 331 you should find this:

Code:
var blueprintTransform = Matrix4x4.TRS(Vector3.zero, softbody.softbodyBlueprint.rotation, softbody.softbodyBlueprint.scale);

skinMap.MapParticlesToVertices(skinnedMeshRenderer.sharedMesh, softbody, transform.localToWorldMatrix * blueprintTransform, softbody.transform.worldToLocalMatrix, radius, falloff, maxInfluences, true, softbodyInfluence, m_softbodyInfluences);

Replace with:

Code:
skinMap.MapParticlesToVertices(skinnedMeshRenderer.sharedMesh, softbody, transform.localToWorldMatrix, softbody.transform.worldToLocalMatrix, radius, falloff, maxInfluences, true, softbodyInfluence, m_softbodyInfluences);

The reasoning for this is that blueprint scale/rotation is already baked into particle rest positions, no need to reapply it during skinning.

Let me know if this fixes your problem.

kind regards,
Reply