Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting sleeping particles
#2
(07-12-2020, 03:22 PM)ibbybn Wrote: Hey there,

I'm trying to build a big underwater kelp forest and for this I experimented with having the big kelp as obi cloth actors.
Each of them are around 500 particles so I'm planning to have maximum up to 10 active at any moment.
The sleep threshold on the solver is always at 0 so they move themselves within the turbulent water.

How can I tell the Burst-Backend solver which particles are sleeping and which active and to ignore the sleep threshold?
 
Already tried disabling ObiClothRenderer but that just stops the rendering and still simulates the particles it seems.
Next thing to try is one solver per Kelp but I'm guessing performance will tank and they won't interact with each other this way.
Is there a simpler solution I havent found yet?

Hi ibbybn!

Sleeping particles do not reduce the solver's workload in any way.
http://obi.virtualmethodstudio.com/tutor...olver.html

Quote:Any particle with a kinetic energy below this value will be freezed in place. This is useful when you don´t want minuscule variations in velocity or force to perturb an actor, making it look like its jittering or moving very slowly.

Sleeping does not work the way it does in a rigidbody engine. Rigidbody engines typically look for "islands" of interconnected rigidbodies that aren't constrained to any rigidbody outside their island. When all rigidbodies in the island are below a kinetic energy threshold, the entire island is excluded from all simulation steps except for collision detection (as collisions can cause the island to wake up again).

In Obi, particle positions are simply not updated if the kinetic energy of the particle is below the sleep threshold. This hides any jittering or unwanted positional drift due to very small forces. However, for all intents and purposes the particle is still simulated and included in any constraints.

Quote:Next thing to try is one solver per Kelp but I'm guessing performance will tank and they won't interact with each other this way.

One solver per kelp is fine in terms of performance. A solver generates a list of simulation tasks that must be performed. Unity's job system (if using Burst) or Obi's job system (if using Oni) will simulate all pending tasks for the frame (in parallel when possible) regardless of which solver originated them.

But, you're right that kelp algae in different solvers won't interact with each other :/.


Personal opinion: using full cloth simulation for kelp might be a bit overkill, depending on how many of them you need. Using procedural simulation in a vertex shader would be a much more efficient approach imho.
Reply


Messages In This Thread
Scripting sleeping particles - by ibbybn - 07-12-2020, 03:22 PM
RE: Scripting sleeping particles - by josemendez - 08-12-2020, 09:32 AM
RE: Scripting sleeping particles - by josemendez - 08-12-2020, 01:13 PM
RE: Scripting sleeping particles - by ibbybn - 10-12-2020, 11:20 PM
RE: Scripting sleeping particles - by josemendez - 11-12-2020, 08:21 AM
RE: Scripting sleeping particles - by ibbybn - 11-12-2020, 01:58 AM
RE: Scripting sleeping particles - by josemendez - 11-12-2020, 08:23 AM
RE: Scripting sleeping particles - by ibbybn - 11-12-2020, 10:38 AM