How it works
Wave surface is generated by summing multiple sine waves on the GPU and stored in a 16-bit float render texture. Each frame, the height map is re-evaluated.
The duck's buoyancy is computed by sampling the height map around its position, then accumulating a rolling average of height and surface normal. It's not physically correct, but gives plausible result.
Ocean surface uses screen-space reflection with a configurable max reflection distance, blended with a scattering term for underwater color.
Render pipeline
- Wave height map pass (256×256 R16F)
- Buoy / object pass (separate framebuffer)
- Ocean surface pass (samples both above)
- Overlay composite
- ACES tone mapping