Plate 01Specimen

No model files

There is no .glb in this project and no texture on disk. The body is one silhouette revolved on a lathe, the bill is a cross-section swept along a drooping spine, and the rest is a handful of spheres and a leaning cone — solved from twelve control points and assembled the moment the page loads.

Drag to turn it. Click to squeeze it.

Plate 02Geometry

Twelve points make a duck

The body is a single silhouette revolved around the Y axis. The bill is the one part that is properly modelled — its shell thins toward the tip, its top carries a dome and its underside stays flat, and the hard edge where they meet is the mouth line. Take the specimen apart to see the pieces.

Pull the slider to separate the parts.

0%
body
Lathe · 12 points revolved
head
Sphere · 56 segments
bill
Cross-section swept along a drooping spine
eyes
Sphere pair, mirrored on X
wings
Spheres tapered to a tip
tail
Cone, flattened and leaned back

Plate 03Surface

Clearcoat does the work

A rubber duck reads as rubber because of one thin glossy layer sitting over a soft diffuse base. Take the clearcoat away and the same geometry turns into painted plaster.

Move the sliders. The material rebuilds on the same frame.

1.00
0.26
0.00

Plate 04Water

It floats on the maths

One height field, written once. The vertex shader displaces the surface with it, and the CPU samples the identical function to set the duck’s height and read the slope under its hull — so the duck rides the crest the shader actually drew.

Click the water to drop a ripple.

Plate 05Swarm

Now do it a few thousand times

The six parts are merged into one geometry with the colours baked into its vertices. That makes the whole flock a single draw call, no matter how many ducks are in it. Positions ease toward the formation you pick.

Pick a formation.

Formation

Fibonacci spiral — equal-area points on a sphere, no clustering at the poles.

Plate 06Colophon

Built in one pass

This page — the geometry, the shaders, the layout and these words — was designed and written by Claude Opus 5 inside The Duck Dose repository. The numbers in the corner are read from the renderer on your machine, not typed in by hand.

Lathe geometry
A Catmull-Rom spline through twelve control points, revolved.
Extruded spline
The bill: a bevelled outline, then drooped by vertex displacement.
Procedural lighting
A studio environment built from area lights — no HDRI is downloaded.
Custom GLSL
The water surface, its normals and the swarm shading are hand-written.
Shared height field
One wave function compiled into the shader and executed on the CPU.
GPU instancing
A merged, vertex-coloured mesh drawn thousands of times in one call.
Scroll-railed camera
Six stations in one world, with the camera damped between them.
Live telemetry
Frame time, draw calls and triangle count sampled from the renderer.

Rubber Duck Lab

A real-time rendering study

The Duck Dose

01 / 06 · Specimen

Assembling the specimen