Crest simulates foam generation by choppy water (ie pinched wave crests) and in shallow water to approximate foam from splashes at the shoreline. Each update (default is 30 updates per second), the foam values are reduced to model gradual dissipation of foam over time.

To turn on this feature, enable Water Renderer ‣ Simulations ‣ Foam ‣ Enabled.

To configure the foam simulation, create a Foam Lod Settings with Assets ‣ Create ‣ Crest ‣ Simulation Settings ‣ Foam Sim Settings, and assigning it to the Water Renderer component in your scene.

Tip

Clicking “New” next to Water Renderer ‣ Simulations ‣ Foam ‣ Settings will create a new one for you.

User Inputs

Crest supports inputting foam data into the system, which can be helpful for fine tuning where foam is placed.

The Foam Input component can write data to the simulation and supports the Texture Mode, Spline Mode, Paint Mode and Renderer Mode. The Texture Mode is the most efficient mode.

The following shaders are available under Crest/Inputs/Foam if using the Renderer Mode:

  • Add From Texture adds foam values read from a user provided texture. Can be useful for placing ‘blobs’ of foam as desired, or can be moved around at runtime to paint foam into the simulation. This is an alternative to the Texture Mode as it can provide more properties to adjust.

  • Add From Vertex Colors can be applied to geometry and uses the red channel of vertex colors to add foam to the simulation. Similar in purpose to Add From Texture, but can be authored in a modeling workflow instead of requiring a texture.

Simulation Settings

Simulation properties are covered with tooltips. This are overviews of each category.

Whitecaps: Crest detects where waves are ‘pinched’ and deposits foam to approximate whitecaps. Shoreline Foam: If water depth input is provided to the system (see Depth Simulation), the foam simulation can automatically generate foam when water is very shallow, which can approximate accumulation of foam at shorelines.

Foam Shading

Foam shading is configured on the water surface material.

There are two foam textures, one with bioluminescence, and one without. If you want sparkles in foam-based bioluminescence, then make sure you are using the packed foam texture.

For a more stylized look, try reducing the Foam Feather value, or provide a stylized foam texture.

Troubleshooting

How do I reduce pixelation when viewed up close?

Find the foam textures and change the compression quality. Removing compression will eliminate pixelation. Be wary that this will increase performance cost.

They can be found in: Packages/com.waveharmonic.crest/Runtime/Textures.