29-10-2019, 10:33 AM
(This post was last modified: 29-10-2019, 10:36 AM by josemendez.)
(28-10-2019, 09:27 PM)IlyaZzz Wrote: Thank You! I reduced Unity's fixed timestep to 0.009 and it helped.
I made few tests and I got that particle collision takes 90% of my resources. But I already had particle collision constraint iterations to 1 and solver substeps to 2.
Do you have any ideas how to fix it?
I can't turn off particle collision...
In Obi 4.x, each substep also performs collision detection (generating contacts, that are later solved by the solver). So having 2 substeps and 0.009 ms timestep, means you might be calculating contacts maxFixedTimestep/timestep*substeps times per frame. Assuming your maxFixedTimestep is Unity's default (0.1) this can mean collision detection is performed 22 (!!!) times per frame.
Try lowering your max fixed Timestep a bit, something like 0.02.
FYI, In Obi 5.x, we have implemented this paper:
http://matthias-mueller-fischer.ch/publi...lsteps.pdf
Which means collision detection is calculated only once per step, and amortized over all substeps. This improves convergence speed without paying any additional cost for collision detection. In this case, you could just increase the amount of substeps to 6-8, leave the timestep untouched and call it a day.