Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimizing Stiff Cloth Object
#1
Hi,



I'm working for a project that's trying to simulate a renaissance manuscript with interactive parchment pages. We're trying to build it for Oculus Quest 2 standalone.


I have the page set up and working well through Oculus Link, so plenty of CPU power, but when I try to build it to run on the quest alone, I only get about 10 frames per second.


I've been building this knowing there's a trade-off between processing power and stiffness, but I'm wondering if someone might know a way to optimize a cloth object while still keeping it stiff. Parchment is a really rigid material, and any time I try to decrease my settings, I get a rubbery sheet.


I'm attaching images of my settings below:


Obi solver:
[Image: dhvWm82.png]
and
[Image: 28rMJcv.png]


Obi cloth object:
[Image: iM8bMA5.png]



3D model:
[Image: oELUFNI.png]



Any help would be greatly appreciated!
Reply
#2
Hi there!

Distance constraints are responsible to keep cloth particles at a fixed distance from each other, so they control the amount of stretching. You're using 8 substeps and 8 distance constraint iterations, but a relaxation of 0.1.

This means your distance constraints are updated 8 substeps + 8 iterations = 64 times per step, but only being applied to 10% (0.1) of their full extent. The result is extremely costly and very stretchy cloth, the exact opposite of what you want.

Most other parameters are also all over the place, and will result in both very expensive and low quality sim.


- Set all your relaxation parameters to 1 (100%). This will ensure constraints are fully enforced, and you make the most of the time spent on them. You could even go slightly past 1 (1.1, or 1.2) to make them pack more punch. See: http://obi.virtualmethodstudio.com/tutor...olver.html

- Set all your iterations to 1. With 8 substeps that should be more than enough. See: http://obi.virtualmethodstudio.com/tutor...gence.html

- You're using a gravity acceleration of -22 m/s2, more than double of Earth's gravity (-9.81 m/s2). This will cause stretching to worsen even more, as distance and collision constraints have to work extra hard to keep gravity from squashing the book flat onto itself.

- You're using a damping factor of 0.99 (99%), which means particles lose 99% of their kinetic energy every second. Probably this was done to counteract the huge gravity, but will not give realistic results. Will look as if the book was submerged in thick jelly.

- A max depenetration of 0.9 m/s means any interpenetrations can only be solved at a separation speed of 0.9 m/s, which is probably not enough. Try between 2 and 5.

Also, I'd recommend installing Burst and taking advantage of the Burst backend. The warning message in your solver inspector is telling you that the engine will fall back to the native backend, which is slightly slower on mobile or mobile-like devices (such as the Quest).

let me know if you need further help. cheers!
Reply
#3
That was extremely helpful, thanks! 

It's much much faster now, though the page became bouncy. I've attached a GIF below:

[Image: uLOqgRF.gif]

What parameter(s) could I change to counteract that effect?
Reply
#4
Hi,

Bouncing happens because potential energy stored in the cloth is being released as kinetic energy (movement). A good solution would be to dissipate part of that energy, which is roughly what damping does.
Try increasing the solver's damping (not too much): Around 0.4-0.8, see if it looks better.
Reply
#5
That's doing the trick, though it looks better and better the higher I put the damping. 

The "submerged in thick jelly" look works for this project, but is there any technical concern to worry about with setting the damping at 0.999?
Reply
#6
(01-06-2021, 08:29 PM)matsborges Wrote: That's doing the trick, though it looks better and better the higher I put the damping. 

The "submerged in thick jelly" look works for this project, but is there any technical concern to worry about with setting the damping at 0.999?

As long as it looks good, there's no downsides to using a high damping value. Performance wise there's no difference between low and high damping values.

Keep in mind though that a value of 1 means 100% of the kinematic energy is dissipated, which will result in the simulation freezing in place. You can get as close to 1 as you need.
Reply