OceanPro — nine weeks building an ocean simulation in UE5 (with technical breakdown)

Hi everyone! I wanted to share OceanPro, the ocean system I’ve been working on in Unreal Engine 5.

It began as a small graphics experiment for my game Portolan, inspired by Sid Meier’s Pirates!, and turned into nine weeks of working on how ocean water moves and looks from the deck of a ship. My earlier water experiments were in Godot; this is the Unreal version.

The current setup has independently adjustable wind and swell, rolling waves, persistent whitecaps, foam around rocks and hulls, and buoyancy.

A few implementation details

  • Wave simulation: The starting point is a seeded JONSWAP spectrum, separated into three FFT bands for long swell, wind-driven waves, and fine ripples. The waves evolve on the GPU, with wind and swell adjustable independently at runtime. Adjusting the spacing of the swell also changes the character of the sea quite noticeably.
  • Whitecaps and foam: Whitecaps are driven by the simulated surface, with foam generated where crests rise and the surface compresses. A GPU texture retains the foam over time so patches can accumulate, persist, and gradually fade. The water material adds finer irregular detail, while foam at rocks and hulls uses a separate waterline effect.
  • Unreal integration: C++ and GPU shaders handle the waves and foam. Live wave data is fed into the water material through a dynamic material instance, and the main controls are exposed through presets and Blueprints. Rendering uses Unreal’s Single Layer Water shading; the ocean simulation is custom rather than based on Epic’s Water plugin.
  • Buoyancy: Boat movement, buoyancy, wave response, and forces run in real time. The goal is to keep the buoyancy component modular so it can be used with different physics-driven actors rather than being tied to one boat controller.

Shoreline treatment is still fairly basic. Most of the work so far has gone into the open-water surface and how it feels up close, because Portolan is experienced from a ship. The reusable buoyancy setup and documentation are also still being polished.

You can see the footage and the original discussion here:

I’d love to hear what you think, especially about the wave motion and foam. Happy to talk more about the implementation!

1 Like