Share

simulate_foam

This computes a dynamic foam on a 2D grid and outputs it in a 2D foam image object that may be used in rendering foam on an object. It inherits properties from the input wave, such as the bounds and whether it is periodic or not.

Inputs

wave

This should be a wave object to compute foam for, which is typically the output of a simulate_spectral_wave or simulation_dynamic_wave node.

Simulation

start_frame

The start frame for the foam simulation.

resolution_scale

This multiplies the resolution of the input wave to determine a resolution for the foam simulation. If this is set to 1.0 then the foam will have the same resolution as the wave simulation. If it is 2.0, the foam would have 4 pixels for every pixel in the wave.

Foam

foam_diffusion_rate

This controls how fast the foam spreads out and dissipates to zero.

cusp_scale

This controls the overall rate or amount of foam emission. It may be mapped with a scalar field to make it less uniform.

cusp_min

cusp_max

This controls the range of cusp values between which foam is emitted.

use_speed

If this is enabled then foam emission is additionally restricted based on the wave speed. The output of velocity must be enabled on the wave simulation for this to work.

speed_min

speed_max

This controls the range of wave speed values between which foam is emitted.

add_mode

When enabled the foam emission is added in each step, otherwise it replaces foam in cusp regions. The add method is generally smoother.

Outputs

out_foam

This is foam data in a 2D image format. It includes the properties foam, speed, and cusp. One may use sample_wave_property to sample these properties at input positions.

Was this information helpful?