source_foam
Allows the user to emit particles from an input liquid volume to create foam.
To use this node, connect a liquid volume into the geometry input, then plug the particle_source
output into the sources
input of a simulate_particles
compound.
Inputs
liquid_object
A liquid volume to create foam for. It should have voxel_signed_distance
and voxel_velocity
properties.
collide_object
An optional volume used in the liquid collisions. This is used to reduce foam emission along boundaries of the liquid where it is in collision (where air cannot mix into the liquid).
Creation Options
These controls affect the act of emission from the liquid source.
emit_rate
Determines how many particles are initially emitted per voxel of the liquid in voxels that are withing the min/max depth locations. These candidate particles are then pruned down by tests for properties like churn and curvature, and precise subvoxel depth to determine the final set of particles to emit.
min_depth
Sets the top of the voxel region in the liquid, in voxels, that emits foam particles. A value of 0
sets the liquid surface as the top of the emission region.
max_depth
Sets the bottom of the voxel region in the liquid, in voxels, that emits foam particles. Positive non-zeros values set the bottom of the emission region below the surface of the liquid. Use a value of 3
for typical foam effects.
min_churn
Threshold value that triggers foam emission, in m/s, based on the angular momentum in the liquid. Set min_churn
to values between 0
and 2
with lower values emitting more foam.
In Bifrost, churning is liquid rotating orthogonal to the surface normal. For example, churn can result from the rotating curvature of a cresting wave or from the turbulence of a washing machine agitator. Areas of the liquid with more churn emit the largest number of particles.
max_solid_depth
Sets the distance, in voxels, between foam emission points and closed boundaries such as collision objects.
Use values between zero and one to maintain a boundary between voxel emission points and collision objects. To emit foam under the liquid surface (bubbles), set max_solid_depth
to a negative value and max_depth
to a high value such as 10
or greater.
emit_flatness
Snaps particles to the surface of the liquid at the time of emission. This prevents particles from being emitted under the surface of the liquid.
When set to 1.0
, particles snap to the liquid surface. When set to 0
the particles are not affected, which allows buoyancy to direct the upward motion of the particles.
offset
Sets a distance, in voxels, between the liquid surface and the foam particles that are emitted at the liquid surface.
When set to a non-zero value, the solver uses offset
to determine whether foam particles are below or above the liquid surface.
min_speed
Threshold value that triggers foam emission, in m/s, based on the liquid velocity. Lower values generate more foam particles. Faster moving areas of the liquid emit more particles.
min_curvature
Threshold value that triggers foam emission based on the formation of curvature on the surface of the liquid. Lower values generate more foam particles. Liquid curvature refers to shapes on the liquid surface, such as those generated by rolling and cresting waves. Areas of the liquid with the steepest curves emit the largest number of particles.
inherit_velocity
Applies acceleration to the emitted foam particles based on the liquid velocity.
When set to 1.0
, foam particles emit with a velocity equal to the liquid velocity. At values greater than 1.0
, foam can shoot off the surface as spray, while values less than 1.0
dampen the particle velocity.
motion_jitter
Randomizes particle positions along the velocity vector when they are emitted. Higher values may help to reduce banding but also may result in a noisier appearance.
emit_rate_multiplier
A scalar field may be connected to this port to multiply the per-voxel emission rate. For example where the field is zero there will be no emission.
This scales the base per-voxel emission of candidate particles and can efficiently vary the total emission, unlike the emit_mask
field, which is used to cull particles after this initial emission.
emit_mask
A scalar field may be connected to this port to mask out emitted particles at precise sub-voxel locations. Where the field is 1.0
or greater there will be no effect on emission, while at zero all candidate particles will be culled from emission.
Values between 0
and 1
represent a probability of not being culled.
Particle Properties
These controls affect the initial value of per-particle properties at emit time.
size
The initial value of the particle point_size
, which is used for collision as well as drawing.
density
The initial value of particle point_density
.
age_limit
The age of particles in seconds beyond which they are killed.
live_forever
If this is enabled then age_limit
is ignored and particles do not die, unless killed with an influence.
additional_properties
One can add additional per-particle properties using this object port. Any simple set_property
on the object passed in will become an array geo property on the particle system. The value on the passed in object will be the value the particles get on emission. For example one could create a set_property node, set the key to color
, set the value to a float3
, then plug it into additional_properties
. The particles will have a color property.
Outputs
particle_source
An object that contains an aggregation of source related inputs to the particle solver and should be connected to the sources
port on a simulate_particles
node.