Skip to main content

Oceanology NextGen - Foam

🌊 Flow-Based
💨 Wave Crests
🎨 Procedural

Configure flow-based foam generation for wave crests, shorelines, and object interactions.


Prerequisites

RequirementDetails
EngineUE5.x (latest release)
PluginOceanology NextGen installed and configured
SceneWater body placed in your level
SkillsBasic Material Instance familiarity
About Foam

Foam parameters are exposed through the OceanologyInfiniteOcean material instance under the Foam category. Foam appears where waves crest, along shorelines, and around interacting objects.

  • The system uses three texture channels: Diffuse (color and transparency), Height (displacement detail), and Normal (surface micro-detail).
  • Foam rendering combines procedural wave data with texture mapping to create realistic coastal patterns, wave crests, and dynamic foam movement.
  • Proper configuration of foam parameters significantly impacts visual quality and performance.

Step-by-step

1. Access the Foam parameters in OceanologyInfiniteOcean

Select the OceanologyInfiniteOcean actor in your level. In the Details panel, scroll to locate the Foam category. This section contains all parameters controlling foam appearance and behavior.

You will find parameters organized into several groups:

Basic Foam Properties:

  • BumpOffset - Vertical position offset of foam relative to water surface.
  • BumpPlane - Blending factor between foam and water surface.
  • FoamOpacity - Overall foam transparency.
  • FoamRoughness - Surface roughness of foam material.
  • FoamContrastLevel - Contrast adjustment for foam visibility.

Texture Mapping:

  • FoamMapping - UV scale for foam texture tiling.
  • FlowSpeed - Speed of foam texture scrolling animation.
  • FlowPower - Intensity of foam flow animation.

Depth Control:

  • FoamDepthMin - Minimum water depth where foam appears.

Wave Integration:

  • FoamWaveNormalZ - How foam follows wave surface normals.
  • WaveDistortion - Procedural distortion applied to foam patterns.

Distance Fading:

  • FadeLengthScattering - Distance over which foam fades from view.
  • FadeOffsetScattering - Starting distance for foam fade.

Color Properties:

  • FoamEmissive - Emissive color gradient for foam glow effects.
  • FoamScattering - Scattering color that affects how light disperses through foam.

Texture Channels:

  • T_FoamDiffuse - Diffuse color and alpha texture.
  • T_FoamHeight - Height displacement texture.
  • T_FoamNormal - Normal map for surface detail.

Foam parameters in Details panel


Foam Parameters Reference

The following sections provide detailed information about each foam parameter category.

Basic Foam Properties

ParameterDefault ValueRangeDescription
BumpOffset0.10.0 - 1.0Vertical offset of foam relative to the water surface. Higher values lift foam above the waves, creating a floating appearance.
BumpPlane0.60.0 - 1.0Blending factor between foam and water surface. Lower values create softer, more transparent edges. Higher values create sharper foam boundaries.
FoamOpacity0.750.0 - 1.0Overall transparency of foam. 1.0 = fully opaque, 0.0 = invisible. Primary control for foam visibility.
FoamRoughness0.20.0 - 1.0Surface roughness of foam material. Higher values create a matte appearance suitable for thick foam. Lower values create shinier, wetter-looking foam.
FoamContrastLevel0.050.0 - 0.5Contrast adjustment for foam appearance against water. Higher values make foam more pronounced and easier to see.

Texture Mapping and Animation

ParameterDefault ValueRangeDescription
FoamMapping16.01.0 - 100.0UV scale for foam textures. Lower values stretch foam patterns over larger areas. Higher values create tighter tiling. Adjust based on world scale and desired foam size.
FlowSpeed0.250.0 - 2.0Speed of foam texture scrolling. Controls how quickly foam appears to move across the surface. 0.0 disables animation.
FlowPower0.050.0 - 1.0Intensity of foam flow animation. Higher values create more dramatic directional flow effects based on wave movement.
WaveDistortion0.250.0 - 2.0Amount of distortion applied to foam patterns. Creates organic, irregular foam edges. Higher values add visual complexity at the cost of performance.

Depth and Wave Integration

ParameterDefault ValueRangeDescription
FoamDepthMin500.00.0 - 2000.0Minimum water depth where foam appears in Unreal units. Foam is visible in water shallower than this value. Lower values restrict foam to very shallow coastal areas.
FoamWaveNormalZ2.00.0 - 5.0Intensity of wave normal influence on foam placement. Higher values make foam follow wave peaks and crests more closely, creating concentrated foam on wave tops.

Distance Fading and Performance

ParameterDefault ValueRangeDescription
FadeLengthScattering600000.010000.0 - 1000000.0Distance over which foam fades due to atmospheric scattering in Unreal units. Larger values extend foam visibility at distance. Reduce for performance optimization.
FadeOffsetScattering1000.00.0 - 10000.0Starting distance for foam scattering fade in Unreal units. Foam begins fading beyond this distance from the camera.

Color Properties

ParameterDefault ValueDescription
FoamEmissiveColor gradientEmissive color applied to foam. Creates subtle glow effects, useful for bioluminescent water, magical effects, or stylized visuals. Left color represents minimum intensity, right color represents maximum.
FoamScatteringColor gradientControls how light scatters through foam. Affects the perceived color of foam when backlit or when light passes through thin foam areas. Useful for achieving realistic subsurface scattering in foam.

Foam Texture Channels

ParameterDefault TexturePurposeRecommended Format
T_FoamDiffuseT_FDiffuseColor and alpha texture defining base foam appearance and transparency mask.RGB + Alpha, sRGB enabled
T_FoamHeightT_FHeightHeight map for foam displacement. Adds 3D surface detail to foam geometry.Grayscale, sRGB disabled
T_FoamNormalT_FNormalNormal map for foam surface micro-detail. Creates fine surface variation and highlights.RGB Normal Map, sRGB disabled

Foam Configuration Guidelines

Use these guidelines to achieve specific visual styles and optimize performance.

Foam Intensity Presets

The following presets provide starting points for different ocean conditions:

ScenarioFoamOpacityFoamContrastLevelFoamMappingFoamDepthMinFlowSpeedWaveDistortion
Calm Ocean0.50.0320.0300.00.150.15
Moderate Waves0.750.0516.0500.00.250.25
Storm Conditions0.90.0812.0800.00.40.4
Shallow Beach0.850.0618.0200.00.20.2
Deep Ocean (Minimal)0.40.0224.01000.00.10.1

Coastal Foam Configuration

Coastal foam appears in shallow water where waves interact with shorelines. Control it with these parameters:

GoalParameterRecommended ValueNotes
More coastal foamFoamDepthMin200.0 - 400.0Lower values extend foam further from shore
Less coastal foamFoamDepthMin600.0 - 1000.0Higher values restrict foam to very shallow areas
Sharper coastal edgeBumpPlane0.7 - 0.9Creates defined foam line along beach
Softer coastal blendBumpPlane0.4 - 0.6Creates gradual foam transition
Brighter beach foamFoamContrastLevel0.06 - 0.1Increases foam visibility against sand

Wave Crest Foam Configuration

Foam that appears on top of waves is controlled independently:

GoalParameterRecommended ValueNotes
More wave foamFoamWaveNormalZ2.5 - 4.0Increases foam on wave peaks
Less wave foamFoamWaveNormalZ1.0 - 1.5Reduces foam concentration on crests
Elevated foam capsBumpOffset0.15 - 0.3Lifts foam above wave surfaces
Integrated foamBumpOffset0.0 - 0.1Keeps foam flush with water
Thick foam bandsBumpPlane0.6 - 0.8Creates wider foam strips on waves

Foam Animation Configuration

Control foam movement and flow with these parameters:

Animation StyleFlowSpeedFlowPowerWaveDistortionResult
Static0.00.00.0No animation, foam is fixed
Subtle drift0.1 - 0.20.03 - 0.050.1 - 0.2Gentle movement
Moderate flow0.25 - 0.350.05 - 0.080.25 - 0.35Noticeable scrolling
Rapid turbulence0.5 - 0.80.1 - 0.150.5 - 0.8Fast, chaotic motion

Performance Optimization

Foam rendering impacts GPU performance through texture sampling, shader complexity, and overdraw. Use these strategies to optimize:

Texture Resolution Optimization

Optimization LevelT_FoamDiffuseT_FoamHeightT_FoamNormalPerformance Gain
High Quality2048x20482048x20482048x2048Baseline (0%)
Medium Quality1024x10241024x10241024x1024~15% faster
Low Quality512x512512x512512x512~30% faster
Mobile512x512256x256512x512~40% faster

Shader Complexity Optimization

Reduce shader instruction count by disabling expensive features:

ParameterHigh Performance ValueQuality ImpactPerformance Gain
WaveDistortion0.0 - 0.1Reduced organic variation~10% faster
FadeLengthScattering200000.0Foam disappears sooner~5% faster
FlowPower0.0 - 0.03Less dynamic flow~3% faster
FoamMapping24.0 - 32.0Tighter tiling (fewer samples)~8% faster

Level of Detail (LOD) Strategy

Implement distance-based foam quality reduction:

Distance RangeFoamOpacityFadeLengthScatteringWaveDistortionNotes
0 - 5000 units0.75600000.00.25Full quality near player
5000 - 200000.6400000.00.15Reduced detail at medium range
20000+0.4200000.00.05Minimal foam at far distances

Custom Foam Textures

Replace default foam textures to achieve unique visual styles.

Preparing Custom Textures

Texture Requirements:

Texture TypeResolutionChannelsCompressionsRGB
Diffuse1024x1024 - 2048x2048RGB + AlphaBC3 (DXT5)✓ Enabled
Height1024x1024GrayscaleBC4☐ Disabled
Normal1024x1024RGB Tangent SpaceBC5☐ Disabled

Foam Texture Styles

StyleDiffuse CharacteristicsHeight CharacteristicsUse Case
Fine bubble foamMany small foam clustersLow height variationCalm seas, gentle waves
Thick frothLarge connected foam areasHigh height variationStorm conditions, turbulent water
Coastal surfIrregular foam bandsMedium height, edge emphasisBeach shorelines
Ice/slushSolid foam areas with cracksSharp height transitionsCold water environments
Polluted/algaeGreenish/brownish tintMinimal heightIndustrial or swamp water

Troubleshooting Common Issues

ProblemLikely CauseSolution
Foam not visibleFoamOpacity too lowIncrease FoamOpacity to 0.5 or higher
Foam only in shallow waterFoamDepthMin too lowIncrease FoamDepthMin value
Foam appears flatT_FoamNormal not assigned or FoamRoughness too highAssign normal texture and reduce roughness
Foam flickering at distanceFadeLengthScattering too lowIncrease FadeLengthScattering value
Foam animation too fastFlowSpeed too highReduce FlowSpeed to 0.1 - 0.2
Foam edges too harshBumpPlane too highReduce BumpPlane to 0.4 - 0.5
Foam not following wavesFoamWaveNormalZ too lowIncrease FoamWaveNormalZ to 2.0 or higher
Performance issuesWaveDistortion and FlowPower too highReduce both values and increase FoamMapping
Foam color looks wrongFoamScattering misconfiguredAdjust scattering color gradient
No foam glow effectFoamEmissive not configuredSet emissive color gradient values

Summary

In this guide, you learned how to:

  1. Access foam parameters - Locate and understand the Foam category in OceanologyInfiniteOcean material instance.
  2. Control foam appearance - Adjust opacity, contrast, roughness, and surface offset for different visual styles.
  3. Configure coastal and wave foam - Use depth parameters and wave normal influence to control where foam appears.
  4. Animate foam - Control flow speed, power, and distortion for realistic foam movement and organic variation.
  5. Customize foam colors - Use FoamEmissive and FoamScattering to achieve stylized or realistic color effects.
  6. Optimize performance - Adjust texture resolution, mapping scale, and fade distances to balance quality and performance.
  7. Replace textures - Import and assign custom foam textures for unique visual styles and artistic direction.
  8. Troubleshoot issues - Diagnose and fix common foam visibility, animation, and performance problems.

With this knowledge, you can fine-tune foam appearance to match your ocean environment's artistic direction, performance requirements, and gameplay needs.