Video:
https://streamable.com/wfnoh9
Pics:
AI written summary:
Water Rendering Overhaul — Foam, Depth Color, Caustics, Gerstner Swell
I've spent some time giving the water system a proper pass.
The engine's water was already strong: scrolling normal maps, Fresnel, planar + cubemap + SSR reflection, depth refraction with leak detection, density absorption, underwater fog, capsule ripples, and large-world support.
This work fills in the pieces that were missing or weak:
- Shoreline foam
- Depth-graded surface color
- Procedural caustics
- Whitecap foam
- A real Gerstner wave model with choppiness and wave-speed control
Everything is driven by new per-material parameters on
WaterMtrl, all exposed in the
Titan Editor → Water Material editor.
The subtle effects — foam, depth color, and caustics — are on by default at low intensity, so existing water looks a little better out of the box without re-authoring.
The heavier Gerstner swell is opt-in:
What's New
Depth-Graded Surface Color
The surface now blends from a
Shallow Color in thin water to the base
Color in deep water, using the water-column depth the shader already computes.
This works especially well for carved 3–100 m procedural lakes/rivers and beaches.
Params:
- Shallow Color
- Depth Color Distance — metres over which it blends; 0 = off
Animated Shoreline Foam
A foam band now appears where the water column gets thin — shorelines, around rocks, and anywhere water meets geometry.
The animation is fully procedural value noise, so no texture asset is required. It churns organically instead of reading as a static pattern.
Params:
- Foam Color
- Foam Amount — 0 = off
- Foam Depth — band width in metres
Procedural Caustics
A cheap two-layer cellular caustic network is projected onto the submerged background and faded by depth.
It is strongest in clear shallows and disappears in deep or opaque water. There is no texture binding, and it is effectively free where the water is deep.
Params:
- Caustic Scale — 0 = off
- Caustic Intensity
Gerstner Swell — Ocean Technique
The Ocean technique now supports real summed-wave vertex displacement with analytic normals.
Set:
to switch the Ocean plane from the legacy texture-bump waves to a proper Gerstner wave sum.
Up to 8 waves are synthesized from a few high-level controls.
Includes:
- Choppiness — horizontal crest displacement for peaked tops and flatter troughs, which is the defining Gerstner term.
- Wave Speed — multiplier on physical deep-water dispersion. 1 = realistic; lower values produce lazy swell, higher values produce faster chop.
- Per-wavelength distance fade — long swells carry to distance while short chop settles out.
- Global horizon envelope — flattens displacement before the horizon so the far ocean does not alias into shimmer or grid moiré.
Params:
- Wave Count
- Wave Length
- Wave Amplitude
- Wave Choppiness
- Wave Wind — direction
- Wave Speed
Whitecap / Crest Foam
Slope-based foam now builds on steep wave faces as the sea picks up.
It is biased onto the downwind, breaking face of the wave rather than appearing symmetrically on both sides.
Demo
Tutorial_14_OceanWater shows everything running on the global sea over a sloped, bumpy seabed rising to a beach.
Everything is runtime-tunable:
- Z / X — calm ↔ storm; ramps wave count, length, amplitude, choppiness, and whitecaps
- O / P — wave speed
- , / . — rotate wind
- F / C — toggle foam / caustics
- Mouse swing + wheel — camera look and zoom
Available in this repo:
https://github.com/DrewGilpin/EsenthelEngine