Skip to content
See what's possible

No. 05 · Case study · Live 3D scene

Under Sail

A live 3D seascape from a five-sentence prompt

A sailing yacht at sea in four kinds of weather, rendered live in your browser, with no 3D models, photos or image files. The methods behind the sea and the sky are well known in computer graphics. Claude Code chose them, wrote the code for them and made them work together in one scene, from a five-sentence prompt.

three.jsWebGL 2GLSL shadersNo 3D models or images Added October 2026
A still frame of the live scene: the yacht at golden hour, its sails lit from behind
Building the sea and sky…

How to use it

Drag
Look around the boat. On a phone, swipe sideways.
Pinch
Move closer or further away. On a computer, Ctrl and scroll, or just scroll in full screen.
Weather
Golden hour, a squall, sea fog or moonlight. The sea changes with the wind.
1 to 4
Once you've clicked the scene: switch the weather. The arrow keys look around, + and - zoom, Space pauses.

What you’re looking at

Everything in that frame is made by code, right now, in your browser. There’s no 3D model of a boat, no photo of a sky, no video of water and no image file. The sea, the clouds, the hull, the sails and the logo on the mainsail are all computed by your device’s graphics chip, dozens of times a second. Switch the weather and see what changes: the waves build up or flatten out with the wind, the light follows the sun or the moon, and in the squall you get rain, whitecaps and lightning.

I wanted to see how far Claude Code gets with 3D, so I gave it five sentences (they’re at the bottom of this page) and let it work. One of the five has a typo: “floating in the clean”. Claude Code read it as the open sea and carried on.

What the prompt left open

The prompt asks for a boat, as photorealistic as possible, in cinematic weather and light, with the Good AI Guide on the mainsail. And it asks for three.js, a free library for 3D graphics in the browser. Every other decision was Claude Code’s. A few of them:

Waves that behave like waves. The sea is computed the way film and game studios do it: measurements of how wind builds up waves (oceanographers call the result the JONSWAP spectrum) are turned into a moving surface with a fast Fourier transform, a standard piece of signal maths, at three different scales, every frame. More wind means taller, longer and steeper waves, and foam where the crests fold over.

A boat that floats on them. The longer waves are added up a second time, on the processor, at five points under the hull, and the boat follows them on springs. That’s why it pitches and rolls with some weight instead of copying every ripple.

Light that follows physics. The sky comes from a model of how sunlight scatters in air, haze and ozone, which a graphics researcher at Epic Games published in 2020. It’s why the low sun turns orange, why the sky above it stays blue, and why moonlight gives you the same sky, only much darker. The boat is lit by the same sun, through the same air.

Sails that glow. Sailcloth lets light through. With the sun behind them, the sails light up and the seams and battens show as darker lines. The print on the far side of the mainsail shows through too, faintly and mirrored, as it does on a real sail. Each side has its own print, placed so it reads the right way round from that side.

Details nobody mentioned. The boat’s home port is Basel, the home port of every yacht that sails at sea under the Swiss flag, and it flies the Swiss ensign. It leaves a wake, its navigation lights come on at night, the camera rides the swell like a camera boat would, and on a narrow phone screen the view widens so the whole boat stays in frame.

It also has a name on its transom: Brilliant New Hire, the picture I use for what AI is at work. That didn’t come from the five sentences. Claude Code ran inside this site’s code and could read my notes on the site and on me, so it knew about the brilliant new hire and that I live in Switzerland. That’s where the name, the home port and the flag come from, and a fresh chat with the same prompt won’t give you them. It’s what Your AI Has No Idea What Your Company Does is about, on a small scale: what an AI knows about you and your work shows up in what it makes.

What Claude Code didn’t invent

If you work in computer graphics, none of the methods behind the sea and the sky will be news to you. Films have computed oceans this way since Waterworld and Titanic in the 1990s, games since the 2000s, and graphics programmers have been sharing seas made purely from code on Shadertoy, a website for graphics code that runs in the browser, for more than ten years. The sky model is newer, from 2020, and was built for the Unreal game engine. The comments in Claude Code’s own code name its sources: Tessendorf’s ocean (the method behind those films), Hillaire’s sky (the 2020 model) and, for the glow around bright light, a technique from the game Call of Duty: Advanced Warfare.

So this is work that has been done many times and written up in papers, tutorials and open-source projects, which is exactly the kind of material AI models learn from. Models are strongest where a lot has been written down. I wouldn’t expect the same from one asked to invent a rendering technique nobody has published.

What impressed me is the rest. A sea on its own is a known exercise. Here it’s one part of a scene where everything has to fit: the boat floats on the same waves you see, and one switch of the weather changes the sea, the sky, the light on the boat, the fog and the rain at once. Then there’s the work specific to this boat, which no tutorial covers: a hull, rig and sails drawn in code, and a version light enough to run on a phone. That’s the brilliant new hire again. It had read the textbooks, and that explains a lot of why this worked. But it still had to pick the right methods, write the code, fit the pieces together and check the result. A graphics programmer could have built this scene. I couldn’t have, and all I typed was five sentences.

What’s not real

Some of it is faked:

  • The clouds are flat: a painted layer with lighting tricks. Look at them for a while and you’ll see it.
  • The boat doesn’t push the water. There’s no fluid simulation: the sea is simply kept out of the hull, and the foam is painted where a real hull would make it.
  • The sails don’t really catch the wind. Their shape comes from a formula (how far out the boom is, how much the sail twists toward the top) plus a little flutter.
  • The rain only falls near the camera, and the lightning is a drawn effect.
  • Phones and tablets get a lighter version, and some of them a simpler one still: fewer waves, simpler clouds and no reflection of the boat in the water. If frames still come too slowly, the scene lowers its resolution by itself.

How it went

Claude Code planned the scene, wrote it, and checked its own work in a loop: render a frame in a browser without a window (driven by a script, so it could take screenshots), look at the screenshot, fix what was wrong, and go again. It went round that loop about 40 times. Some of what it caught:

  • The sun came out as a black dot. It was brighter than the image format could store, and the overflow turned it black.
  • The rain was invisible. Every raindrop faced away from the camera, and graphics chips skip surfaces they see from behind.
  • The squall first looked like a mild grey evening. The haze under the storm cloud was being lit as if the sun reached it.
  • The sails had stripes, because each sail is a single sheet and it was casting shadows onto itself.

One of its own tests flagged the waves as too high: 2.3 metres in a wind for which a textbook rule of thumb predicts 1.6. Claude Code worked out that the rule of thumb and the wave spectrum the scene is built on already disagree by about 30 percent, treated the spectrum as the reference, and changed the test rather than the sea.

The finished scene is about 6,300 lines of code in 19 files, tests for the maths included. I haven’t changed a line of it.

The general version at the bottom of this page asks for nothing confidential, only a name for the sail, so you can try it on whatever you have, including the assistant your employer gave you. If you want to see what a coding agent is like to work with, Using Claude Code is where I’d start.

What I typed

My prompt, word for word

For the "What's possible" section, I want to look into your 3D modelling abilities and your prowess with three.js. Build a 3D render of a boat floating in the clean, as high quality and photo realistic as possible. Create cinematic conditions through weather and light. The boat should have Good AI Guide branding on its main sail. Use three.js.

Only the first sentence needed my project: it told Claude Code, which was working inside this site's code, which section the scene was for. The other four work anywhere, though the boat's name, its home port and the Swiss flag came from my notes in the project, not from the prompt. The version below drops the first sentence, fixes my typo and leaves the name on the sail to you.

A prompt to start from

Try it yourself

Put your own name on the sail:

Build a 3D render of a sailing boat floating at sea, as high quality and photorealistic as possible. Create cinematic conditions through weather and light. The boat should have [your company's name or logo] on its mainsail. Use three.js.

If you can run code, render the scene in a browser, look at screenshots of it and fix whatever looks wrong. Keep going round that loop until it looks right.

A chat assistant like Claude, ChatGPT or Gemini will likely give you a simpler version in a single file. For a scene like this one you'll want a coding agent such as Claude Code or Codex, one that can create files, run them in a browser and look at what it made. Claude Code went round that loop about 40 times here.

The newsletter

Straight from my own work with AI

About once a month: what I tried with AI, what didn't work, and what you can use yourself.

Read the latest one first: The greatest AI model in history (so far)(opens in a new tab)