How can a game simulate the way real waves break near the shore? Developer FinSaltSwell showed us the approach used in their early surfing prototype, Swell.
I came across a post a few days ago from a developer going by
FinSaltSwell. The post showed an early build of a surfing game he’s been working on for about a year, built in Unity as a solo project.
The goal behind the project, currently codenamed “Swell,” is fairly simple: create a surfing experience that behaves closer to the real sport. Instead of focusing on exaggerated tricks and endless perfect waves often seen in arcade-style surfing games, the project explores things like wave positioning, carving along the face of a wave, and navigating sections that don’t always break perfectly.
After a short exchange, FinSaltSwell shared some background about the wave system and the approach used to shape how waves break in the game.
Surfing Games and the Challenge of Waves
Surfing games have never been especially common, and part of that comes down to how difficult waves are to simulate. Both the movement of water and the interaction between a surfboard and a breaking wave introduce a lot of complexity in real time.
FinSaltSwell mentioned that
Kelly Slater’s Pro Surfer was one of the games he played the most growing up. That title, like many others in the genre, had a very arcade-style approach to surfing. Waves were often perfectly shaped, tricks could chain together indefinitely, and the gameplay revolved mostly around scoring tricks.
So, the interest in the project started from a simple idea: what would a surfing game look like if it tried to represent the sport more faithfully? That question eventually led to the wave system behind Swell.
So How Do Real Waves Break?
In real surfing conditions, the way a wave breaks is strongly influenced by the
shape of the ocean floor near the shore, a concept known as
bathymetry.
As a wave moves toward land, the water beneath it becomes shallower. This causes the wave to slow down and grow taller, a process called shoaling. Once the wave reaches a certain height relative to the water depth, it begins to break.
(Bathymetry map by the National Oceanic and Atmospheric Administration (NOAA), via Wikipedia.)
Small variations in the seabed can dramatically change how that happens. If the ocean floor slopes gradually from one side to the other, the wave might start breaking on one side first and continue along the face of the wave. Surfers often refer to these as "lefts" or "rights," depending on the direction the wave peels.
Other conditions produce closeouts, where the entire wave breaks at once, or A-frame waves, where the break travels in both directions from a central peak.
Using Depthmaps to Shape the Waves
The system in Swell uses a concept similar to terrain heightmaps. Instead of representing elevation, however, the texture represents ocean depth.
FinSaltSwell described this as a depthmap, where the red channel stores bathymetry values. In this case, the texture works much like a heightmap would: lower values represent shallower areas, while higher values represent deeper water.
As waves travel through the scene, the system samples this depthmap. The bathymetry information determines which parts of the wave begin increasing in height as they approach shallower regions.
Once a certain height threshold is reached, the wave begins to break.
Because the depthmap defines how depth changes across the seabed, adjusting the texture changes the breaking profile of the wave. A slope running diagonally across the texture can produce a wave that peels from one side to the other. Different shapes can produce closeouts or waves that break in multiple sections.
In practice, these textures define how the wave breaks across the shoreline.
The first versions of the system looked quite different from the current implementation.
FinSaltSwell mentioned that Swell started as a 2.5D experiment, partly because it was their first time ever working on a full 3D project. The early waves were represented by planes rotated ninety degrees, already driven by the depthmap approach described earlier.
Later builds moved toward a more complete 3D implementation as the project evolved. Even at that stage, the same bathymetry-driven system remained central to wave formation and breaking.
Are you interested in seeing more from FinSaltSwell? For now, their Reddit profile is the main place where they share updates about the project, check it out:
Interested in learning more?
If you are interested in the technical art side of game development,
the Technical Artist Bundle brings together three books that explore shader programming, game development math, and procedural visuals in Unity.
It’s designed for developers and artists who want to better understand the technical side of graphics, whether you are starting out or looking to expand your skills and knowledge.
Jettelly wishes you success in your professional career!
Did you find an error? No worries!
Write to us at [email protected], and we'll fix it!