Skip to content

WHITEWATER

Set TopicsSET TOPICSep 28, 2026Original source

When water collides with objects or moving turbulently, it is becoming foamy - we call this “whitewater”. Typically wave crests, water splashing on rocks, waterfalls, rapids.
In the ninja project, whitewater consists of two visual components: material shaders and particles

  1. we use material shaders to generate foam at the water surface, in most cases.
    A. in the simulation area, we are using the FlowMap function group of the Output Material. Key parameters are EnableFlowDetailsNoise (should be set to True in order to have this function running) and MaskFlowMapWithCameraDistance - which could be used to fade in and fade out the flowmap - depending on its distance from the camera
    B. in the simulated area and outside the simulated area, we are using the TileMap function group of the Output Material. Tilemaps are mainly made to generate passive (non-interactive) patterns for the mid and far background - and we usually fade them out close to the camera, using the MaskTileMapWithCameraDistance parameter.

  2. occasionally, we use particles, to further improve the look of the whitewater. The particle emitter is usually added as a Component to NinjaLive Actor. We have a similar “distance to camera” based fade option implemented in the material applied to particles. We can access the particle material by looking up the Particle Component at the Live Actor Details Panel, selecting the component, and at the Component Details Panel, locate the User Parameters param group. In User Parameters, under the Renderer subgroup, we find the SpriteMaterial Parameter, where we can access the Material applied to the particles. By opening the Material, at the Material Instance Details Panel, we will find a parameter group named DistanceFade - params in this group are responsible to fade the particles - if close to the camera. We can adjust this or this off.

A related post: “Surface Aligned Particles Glitch”