Plain shader
No engine and no library: one fragment shader on a bare WebGL canvas. The fox is round bars and balls melted together, with joints worked out on the CPU each frame; the grass is one bent blade a square of a grid, and each pixel walks a ray through all of it.
- Real time
- Yes, on a fair graphics card. Every pixel asks about nine blades and the whole fox at every step of its ray, so it is the dearest of the four here.
- What moves
- The trot, the brush, the wind in the grass and the wisp, each as a formula typed out for this scene.
- The light
- Worked out afresh for every pixel. The fox and the stones cast soft shadows from the wisp; the grass does not, because that would mean a second walk through every blade.
- Written as
- 471 lines, most of them one shader
- Speed here
- not timed yet
- What you keep
- A picture. The scene lives only in the shader’s formulas, so nothing can be saved as a model or opened in another tool.
- Where it stops
- A coat is the hard part: the surface is roughened and streaked, which reads as fur from here and would not close up. A second animal means writing this again from the first line.