Density Constraints

Density constraints try to keep the amount of mass in the neighborhood of a particle constant. This smoothly avoids particle clumping, making them behave like an incompressible fluid.

Particles flagged as "fluid" automatically apply a density constraint to the area around them. Particles are flagged as "fluid" by ObiEmitters using a fluid emitter material. The ObiEmitter component determines how the particles are emitted/spawned, while the emitter material determines all density constraint parameters (pressure, viscosity, polarity/surface tension, etc) that determine the physical behavior of the fluid.

In addition to controlling the behavior of fluid particles, density constraints can be used to drive the motion of passive particles (called diffuse or foam particles) using the fluid's velocity field, in a process called advection. This way, only a few fluid particles are simulated while many more are "carried" along the fluid particles. The ObiSolver component contains some global foam advection-related parameters, which you'll find listed here. For more information on how to spawn foam particles, see advection.

Solver settings

Diffusion mask

Scales the diffusion speed for each of the 4 user data channels for fluids. Setting the diffusion mask to zero for specific channel(s) is useful in some situations, for example, when storing custom per-particle data that you don't want to be affected by diffusion.

Foam substeps

Maximum amount of substeps that perform particle advection. Usually a single substep is enough, but it may cause advected particles to not follow simulated particles exactly. For higher-quality simulations or when performance is less of an issue, you can crank up this value to get more accurate advection.

Foam min neighbors

Minimum amount of fluid particle neighbors each foam particle must have in order to be considered as "inside" the fluid, and be advected by it. Any foam particles having less neighbors will behave ballistically.

Foam collisions (Compute only)

By default, foam particles rely on neighboring fluid particles to handle collisions. This is extremely cheap as it doesn't require foam particles to perform any explicit collision detection of their own, but it's not very effective - specially for spray/ballistic particles, as they have few or no fluid neighbors.

The compute backend can optionally perform full collision detection of foam particles against ObiColliders, you can enable foam collisions in the ObiSolver component. Collision response is inelastic and frictionless. This helps obtain sharp contact silhouettes and can make spray feel more "grounded" as it doesn't pass trough objects in the environment. Note this is usually a costly option, due to the amount of foam particles that are usually present in a scene.

Foam collisions disabled, foam just follows nearby fluid particles which results in "fuzzy" collisions against the capsule collider.
Foam collisions enabled, each individual foam particle is tested for collisions which results in a sharp, clear silhouette where foam meets the capsule collider.

Foam radius scale

Foam particles are rendered as uniformly colored ellipsoidal splats, each splat has a color and size determined by the ObiFoamGenerator/Emitter that spawned the particle. The size of all foam particles in the solver can be globally scaled using this parameter.

Foam radius scale = 1. Individual particles can be clearly seen.
One way to fix this is to just make particles larger, by setting the solver's foam radius scale to 2.

Foam gravity scale

Advected particles that have very few simulated particles in their neighborhood will follow a ballistic trajectory under the influence of the solver's gravity, simulating spray. This parameter allows you to scale gravity, making it more intense, less intense or even reversing it.

Foam fade

Determines how advected foam particles fade in/out at the start/end of their lives. The slider's left end determines fade in time, and the slider's right end determines fade out time. Fading is performed by modulating the particle's alpha channel.

Foam Accel Aging Range

Solvers preallocate a maximum amount of foam particles (that you can set in the Memory Budget section). When the amount of used/active foam particles goes past a % of the maximum, all foam particles begin to age and die faster. This is an attemp to reduce the amount of used particles and make room for new particles to spawn. The Foam Accel Aging Range determines the minimum and maximum % of used particles that triggers accelerated aging. Up to the minimum %, particles will age normally. At the maximum %, they will age faster according to Foam Accel Aging.

Foam Accel Aging

Aging speed multiplier used when the amount of active foam particles reaches o exceeds the upper range of Foam Accel Aging Range.

Foam volume density, ambient density, scatter color and ambient color

Each individual particle has no shading of its own, however when using density control (only available in the Compute backend, see advection) particles will calculate a directional occlusion value by looking at the position of other foam particles around them, measuring of how much light reaches each particle from the direction of the light.

This is a cheap way to simulate volumetric scattering, and can be used to alter the color of particles using a single-scattering lighting model controlled by four parameters: foam volume density, foam ambient density, foam scatter color and foam ambient color. It's useful for large clumps of foam particles -such as thick foam or gases-, not so much for thin/sparse foam particles.

Gas rendered with low volume density. Shadowing is subtle, as light is let trough particles.
Gas rendered with high volume density. Shadowing is more defined, as foam particles absorb more light.

Max foam velocity stretch

Advected particles can stretch along the direction they're moving, this is an inexpensive way to fake motion blur and gives an extra visual cue to their overall movement. This parameter allows you to control their maximum stretch ratio, 0 being no stretching (1:1 height width ratio), 1 allowing a ratio of 2:1, 2 allowing a ratio of 3:1, and so on.

Zero maximum velocity stretch. Particles are perfectly round.
Non-zero maximum velocity stretch. Particles become ellipsoids, stretched along the direction they're moving.