Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Preventing fabric from vibrating and drooping
#1
We have a system where a virtual garment is procedurally generated, consisting of multiple fabric shapes stitched and stretched around the character model. I’ve noticed an issue where the fabric vibrates and sometimes clips through the model, and I think this is because of the fabric being stretched too tight.

I tried loosening the stretch scale and stretch compliance (they’re normally at 1 and 0 respectively), but any value loose enough to stop the vibrating also resulted in the fabric drooping and losing its shape (more than it already does). I compensated by increasing the particle inverse mass (to try and decrease the mass and make the fabric less likely to droop down), but this makes it start vibrating again.

Another solution I thought of was to directly modify the mesh before generating. The cloth has two halves, front and back, which are initially flat meshes. I made some code that uses raycast checks to manually modify each vertex, to make the mesh wrap more closely around the body. This reduces some of the vibration, but still has some jittering and causes the fabric to droop (albeit in a slightly more crinkly and polygonal way).


I've been thinking about making a system to have most of the garment non-simulated. so it conforms to the model and doesn't move about in ways it doesn't need to, but since the garment is procedurally generated I'm not sure yet how to differentiate between the bits that need to simulate realistically and the bits that can stay in place.

What other methods could I try to reduce jittering?

Thanks!
Reply
#2
(09-02-2025, 04:22 AM)CptnFabulous Wrote: We have a system where a virtual garment is procedurally generated, consisting of multiple fabric shapes stitched and stretched around the character model. I’ve noticed an issue where the fabric vibrates and sometimes clips through the model, and I think this is because of the fabric being stretched too tight.

Hi!

There's multiple possible causes of jittering. The most common are:

- Collision against a distance field that's not completely convex. Distance fields can only store the distance to the closest point in a shape (won't store the 2nd closest, the 3rd closest and so on), this means that if a particle is pushed into a concave area of the collider -say, a corner between 2 flat sides- it will alternate between colliding with whatever side is closest during the current frame. This may lead to jittering.

- Distance constraints using sequential evaluation mode may jitter when really overstretched. You can switch to parallel mode, this will eliminate jitter but does converge slower (meaning the cloth will droop more, and will need more substeps/iterations to reach comparable stiffness). See "evaluation mode" near the bottom of the solver's manual page.

(09-02-2025, 04:22 AM)CptnFabulous Wrote: I tried loosening the stretch scale and stretch compliance (they’re normally at 1 and 0 respectively), but any value loose enough to stop the vibrating also resulted in the fabric drooping and losing its shape (more than it already does). I compensated by increasing the particle inverse mass (to try and decrease the mass and make the fabric less likely to droop down), but this makes it start vibrating again.

As long as all particles in the cloth have the same mass, behavior will be unaffected by the mass value used: heavier objects don't fall faster, since gravity is an acceleration, not a force. Stretch scale and compliance should be 1 and 0, increasing stretch scale will make the cloth larger (as the distance between particles gets scaled) and increasing compliance will increase the fabric's stretchiness. Increasing them may stop jitter as cloth is no longer stretched, but they introduce the opposite problem: it will become too saggy.

(09-02-2025, 04:22 AM)CptnFabulous Wrote: What other methods could I try to reduce jittering?

I would try switching distance constraints to parallel mode, then spending 1-2 extra substeps in the simulation. You can also try slightly increasing the solver's sleep threshold parameter, the way it works is it freezes in place any particles with a velocity value smaller than the threshold. This should eliminate small amounts of jitter, but don't overdo it or the cloth will behave in a stop-motion kind of way.

kind regards,
Reply