Skip to builds

Storm sea (WebGPU ocean)

This build is a physically simulated 3D scene in raw WebGPU, built from nothing with no imported models or textures. Everything is drawn in code.

  • GLM 5.2
  • Kimi K3

The prompt

# Build Prompt — Odyssey Storm Sea

A single build. Procedural open-sea graphics test, themed to _The Odyssey_: a stormy
sea you control, with Odysseus' ship riding the swell. Everything is generated in code
— no imported models, textures, or assets, including the ship.

---

You are a world-class WebGPU, Three.js, and TSL graphics engineer; create a
production-quality full-screen procedural open-sea experience.

Deliver a directly runnable index.html and main.js using native ES modules, with no
framework, build step, image texture, HDRI, model, or video.

Use WebGPURenderer and TSL to displace a dense plane with exactly five Gerstner waves
and derive stable analytic swell normals.

Add animated gradient-noise FBM for capillary detail, then shade deep water, Fresnel
reflections, backlit crests, sun glitter, foam, and horizon haze.

Use one analytic sky function and shared uniforms for both the sky dome and water
reflection, including sun disk, halo, clouds, and time-of-day palettes.

Include TSL bloom, ACES tone mapping, damped OrbitControls, slow drift, and controls
for sea state, time of day, drift, and live FPS.

Handle WebGPU detection, loading and failure states, resize, touch input, capped DPR,
hidden-tab pausing, accessibility, and performance safeguards.

Return complete executable code and brief launch instructions, with no placeholders,
invented APIs, console errors, or hidden fallback rendering.

## Additional requirements — the Odyssey storm

**Controllable weather — one master `stormIntensity` (0 → 1).** A single slider drives
the whole scene from dead calm to full tempest; everything below is a continuous
function of it. Expose it alongside sea state, time of day, drift, wind direction, and
live FPS.

As `stormIntensity` rises:
- **Sea:** Gerstner wave amplitude and steepness ramp up (choppier, taller, sharper
  crests); whitecap **foam** thresholds lower so more crests break into foam; capillary
  FBM detail intensifies.
- **Sky:** the time-of-day palette darkens and desaturates toward slate-grey/green; the
  analytic clouds thicken, lower, and blacken into a cumulonimbus ceiling; the sun disk
  dims and reddens.
- **Wind:** a `windDir` vector stretches wave anisotropy and blows **spray** off the
  crests and a **rain** system (see below) along the wind direction.
- **Rain:** GPU-instanced streaks (elongated along velocity), density and speed scaled
  by intensity, with a subtle screen-space wet/mist fog near the camera at full storm.
- **Lightning:** intermittent strikes — a brief full-scene **emissive flash** + a
  temporary high-intensity light that momentarily lights the sea and the ship from the
  flash direction; mix sheet (sky glow) and occasional fork (a jagged procedural bolt).
  Optional **Web Audio** thunder crack, delayed after the flash. No imported assets.

**Odysseus' ship — built entirely in code** (procedural geometry only): a Homeric-era
Greek galley, constructed from primitives —
- **Hull:** a lofted/curved dark-wood hull with a **high curved sternpost and prow**;
  an **oculus (painted eye)** on the bow.
- **Mast + yard** carrying a **square sail** rendered as a subdivided plane that
  **billows** via noise/simple cloth deformation driven by `windDir` and intensity; at
  high storm it snaps taut, luffs, and **tears** (torn edge / flapping strips).
- **Oars** in banks along both sides.
- **Buoyancy:** sample the Gerstner surface **height and normal at several points along
  the hull** (bow, stern, port, starboard) each frame and solve the ship's **heave,
  pitch, and roll** from them, so it genuinely rides and slams through the swell — more
  violent as intensity rises. Add a **bow wake** and foam where the hull meets water.
- **Figures:** suggest Odysseus and his men as simple low-poly silhouettes on deck,
  bracing against the pitch.

**Camera:** a smooth **damped** rig that can follow the ship (framing it against the
storm) or free-orbit; slight camera shake on nearby lightning.

**Keep everything procedural** — no image textures, HDRI, models, or video anywhere,
including the ship, sail, rain, spray, lightning, and figures. Preserve all the runtime
handling above (WebGPU detection, loading/failure states, resize, touch, capped DPR,
hidden-tab pause, accessibility, performance safeguards, live FPS).

The exact prompt from the published test.

The builds

GLM 5.2 · Screenshot of the buildRuns in your browser

The full write-upGLM 5.2 vs Kimi K3: Which Cheap Coding Model Actually Wins?Read the article

Written by

Pat Simmons. Pat tests AI models and tools on the AI for Mortals YouTube channel.

AI FOR MORTALS.

Your daily AI edge that will make everyone wonder how you do it all.

Every weekday, the practical AI updates that matter, and exactly what to do with them.

The latest in AI, in plain English. Free, every weekday.