20-09-2017, 12:38 PM
(This post was last modified: 20-09-2017, 12:39 PM by josemendez.)
(20-09-2017, 11:52 AM)sunyifeng83 Wrote: I have encountered a performance problem. When i simulate a faucet emitter with 1000 particles limit, the fps will drop obiviously with the particle nums adding. Finally the fps will dropped to less than 10fps. I have attached my configurations and the function WaitForAllTasks spent time. How can i get over the problem. Any help will be appreciated!
Hi!
Take a look at this video, it treats exactly the problem you're having:
https://www.youtube.com/watch?v=sUVqa-72-Ms
Basically, reduce the Max Physics Timestep setting (ProjectSettings->Time) in Unity to avoid your physics being updated 12 (!) times each frame -as the profiler shows in your screenshots-. They should not update more than 2-3 times frame.
FYI, "WaitForAllTasks" waits for all parallel Obi tasks to end, since they're spawned and done in multiple threads. So this function actually waits for all the simulation work to be done by the engine.
Edit: If you need some approximate settings to start with, use a Fixed Timestep of 0.02 and a Maximum Allowed Timestep of 0.06.
cheers!