
A short week, right after the kick-off post. Only two changes, both in Level 1. But one of them is the kind that, when it finally works, makes you stare at the screen without playing.
The water finally looks like water
Last week the sea got waves. The surface rose and fell, the foam breathed around the blocks… and still something didn’t quite convince me. The water moved, but it didn’t shine. It looked like a sheet flapping under flat light, with no volume, no sparkle.
Now every wave catches the light. Faces turned to the sun light up, faces turned away darken, and sky reflections dance over the crests. A small change in code and a huge one on screen.

More island below the surface
Groups 2 and 3 of Level 1 now have their place under the water. Until now they sat up top, in their final position, just waiting. Now they sleep submerged, as in the image above: you can make them out from the shore, a blurry staircase under the swell, and they rise block by block when you press their button. Every week a little more of the level works as it should: you step, you press, and the archipelago grows.
Along the way I closed a shortcut that shouldn’t have existed. Group 2’s button was visible from the start, so you could raise group 3 without going through group 2. Now that button sits on one of its group’s blocks: it sleeps under the water with them and only appears when its turn comes.
🔧 Under the hood: waves that didn’t know which way they were facing
The waves are Gerstner waves, a classic model that moves each vertex of the mesh in circles: up and forward at the crest, down and back in the trough. The result has the shape of a real wave. But the light didn’t notice… Read more
The problem
Moving a vertex doesn’t change which way it “faces”. To compute lighting, every point on a surface needs its normal: an arrow perpendicular to the surface that says which way it’s oriented. The glint of the sun, the reflections of the sky, the difference between a lit face and one in shadow… all of it comes from comparing that arrow with the direction of the light and of the camera.
And our mesh started out as a flat plane. All its normals pointed straight up. When the waves deformed it, the shape changed, but the normals kept pointing at the sky, as if the water were still a flat mirror. As far as the light was concerned, the sea had no waves.
On top of that, the water shader was unlit: it painted colours without computing any lighting at all. Until now that didn’t matter, because without correct normals it wouldn’t have helped much anyway.
The fix
The good news about Gerstner waves is that they’re a formula, and from a formula you can work out the slope at any point. For each vertex:
- Work out how much the surface changes if you move a little along the X axis. That gives an arrow tangent to the wave in that direction.
- Do the same along the Z axis, which gives a second tangent arrow, perpendicular to the first.
- The cross product of those two arrows is exactly the normal: the direction perpendicular to both, the one that points “out” of the surface.
Since there are two overlapping waves, their contributions are added together before taking the product. The result is written into the vertex normal, replacing the one from the original plane.
With correct normals, switching the shader to lit finally made sense. I turned on specular highlights and environment reflections, on both the near mesh and the far horizon plane, and gave each wave its own speed on the far plane so it wouldn’t move as one block.
I like this kind of fix because it adds nothing new to the world: the waves were already there. It just explains to the light what they look like.
What’s next
- Keep building
Level 1beyond group 3. - Set up the groups in
GymandLevel 2for the new rising system. Their blocks are visible but don’t count. - An editor warning when a group has neither a resting pose nor starts raised, so a group never ends up untouchable without anyone noticing.
See you next week.
Enjoyed this? Get every new devlog post in your inbox.