Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Performance issue and massive frame drops
#1
Hi 

The idea is to have a costume consisting of approx 50 non-stretchy ropes, attached to an avatar (animated with mocap suit) and previewed in VR in real-time. 
The problem is that even a simple prototype with 6 ropes with low resolution and length is running 10fps only, which makes it unusable for my use case.

What I have done
-created Rope Blueprint (thickness: 0.003, resolution: 0.1, pooled particles: 0, length: 0.3m)
-set up 1 obi solver (distance constraint iterations: 10, substpes: 1)
-created 6 ropes (used particles: 55)
-attached each rope to joint of low-poly avatar (using obi particle attachment)
-added 4 capsule colliders to avatar to avoid ropes going through body

I'm using Obi 5.0 in Unity 2019.2.9f1 on a PC with i7-6700 processor and GeForce GTX1070. 

The question is what is causing the performance issue? Does it have to do with the rope setup itself (and if so how to set up the rope in order to be efficient in terms of performance and also look quite stiff)? Is it because each rope is attached to the avatar's join which is moving quite fast? Or what else can be causing and and how it can be fixed?

Thank you in advance


Attached Files Thumbnail(s)
   
Reply
#2
(01-01-2020, 10:14 AM)Maria Wrote: Hi 

The idea is to have a costume consisting of approx 50 non-stretchy ropes, attached to an avatar (animated with mocap suit) and previewed in VR in real-time. 
The problem is that even a simple prototype with 6 ropes with low resolution and length is running 10fps only, which makes it unusable for my use case.

What I have done
-created Rope Blueprint (thickness: 0.003, resolution: 0.1, pooled particles: 0, length: 0.3m)
-set up 1 obi solver (distance constraint iterations: 10, substpes: 1)
-created 6 ropes (used particles: 55)
-attached each rope to joint of low-poly avatar (using obi particle attachment)
-added 4 capsule colliders to avatar to avoid ropes going through body

I'm using Obi 5.0 in Unity 2019.2.9f1 on a PC with i7-6700 processor and GeForce GTX1070. 

The question is what is causing the performance issue? Does it have to do with the rope setup itself (and if so how to set up the rope in order to be efficient in terms of performance and also look quite stiff)? Is it because each rope is attached to the avatar's join which is moving quite fast? Or what else can be causing and and how it can be fixed?

Thank you in advance

Whenever a performance issue arises, profiling is the answer. 6 low-res ropes at 10 fps is not normal. I'd expect around 200-300 fps at the very least, even more in a standalone build. We got 50 1-meter ropes running at 60 fps in an iPad, so a i7 should be able to handle many more.

My take would be this is a case of death spiraling. Take a look at the profiler and see how many times per frame is FixedUpdate() being called. More than once per frame would confirm my guess. If that's the case, lower Unity's max timestep setting.

Also a hint: use substeps instead of iterations if possible. They boost convergence (roughly translates to increased stiffness) a lot more, for the same cost. This is thoroughly explained in the manual, see:
http://obi.virtualmethodstudio.com/tutor...gence.html
Reply
#3
(07-01-2020, 11:05 AM)josemendez Wrote: Whenever a performance issue arises, profiling is the answer. 6 low-res ropes at 10 fps is not normal. I'd expect around 200-300 fps at the very least, even more in a standalone build. We got 50 1-meter ropes running at 60 fps in an iPad, so a i7 should be able to handle many more.

My take would be this is a case of death spiraling. Take a look at the profiler and see how many times per frame is FixedUpdate() being called. More than once per frame would confirm my guess. If that's the case, lower Unity's max timestep setting.

Also a hint: use substeps instead of iterations if possible. They boost convergence (roughly translates to increased stiffness) a lot more, for the same cost. This is thoroughly explained in the manual, see:
http://obi.virtualmethodstudio.com/tutor...gence.html

By reducing the max timestep it makes the game run slower with a higher fps. This is not desired. On top of that even when I get the Obi fixed update to be called 1 per frame, that single fixed update is using 20% of cpu time. That is a lot
Reply
#4
(20-02-2020, 06:52 PM)hazneliel Wrote: By reducing the max timestep it makes the game run slower with a higher fps. This is not desired. On top of that even when I get the Obi fixed update to be called 1 per frame, that single fixed update is using 20% of cpu time. That is a lot

Hi Maria,

Reducing the max timestep will cap the amount of wall-clock time advanced in the physics world, so it will increase your fps at the cost of "skipping" simulation time if your frames take longer to render than a single step. An alternative would be increasing the timestep (fixed timestep, not max timestep).

20% of CPU time depends on what your total CPU consumption for a frame is. Also, higher CPU consumption % is generally better as that means all cores are busy. So depending on your case, It can be a lot, or very little. How many ms/frame does the solver take to perform a step?
Reply