Realtime Ocean Waves

  • Software UE4

Full control over the waves through blueprints and instantiated actors

I created a water shader and modular wave spawning system purely driven by displacement calculations. Nothing is pre-baked and everything is created by material functions and done by maths.

I researched physics, common realtime wave functions and algorithms to get the main displacement right.

Sin Function

Sin Wave Z-axis displacement in UE4

Gerstner Function

Parametrically controllable Gerstner wave 3D displacement in UE4

The summation of 4 Gerstner waves and a sin wave

Once I was satisfied with the general liquid back and forth movement of the gerstner wave and sin wave displacement summations, I moved on to creating the water surface shader and foam shader, done through panning normal maps and albedo textures combined with worldspace noise.

After this I implemented the curl effect by rotating the top parts of the wave with an angle controllable through blueprint.