A sea shader made in Unreal Engine 4 which uses Gertsner waves instead of simple sine-based or heightmap-based offset.
The Gerstner function is defined directly in the shader and allows for sharp crests as well as X and Y displacement.
This shader is mostly based on NVidia's GPU Gems :
https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch01.html
I used UE4's Custom Depth to allow the translucent material to occlude itself, otherwise farther pixels would be rendered before closer ones. I used Mesh Distance Fields to mask the foam around intersecting geometry. Reflections are rendered with a planar reflections actor but it works well with SSR as well.
Additional textures were made in Substance Designer.
UE4 Sea Shader