## 1. Your prompt, rewritten

> "Animate my attached bot (a white sphere with two slanted black capsule eyes) using as many FX (effects) techniques as possible. Draw from early gaming through modern real-time 3D, film, video and painting. Think like an animator, director, game developer and fine artist. First give me the full catalog, ordered by sequence. Then build one bot at a time as a live, interactive demo. Keep the character consistent across all demos. Pause after each one. Flag any technique that needs an external API before you use it."
## 2. What option 15 shows

- **The bot is a formula, not a model.** For any point in space, the shader can answer: "how far am I from the nearest surface?" Each pixel's ray jumps forward by exactly that distance, again and again, until it's close enough to call a hit.
- **Blending is one line of maths.** A "smooth minimum" merges two shapes with a rounded fillet instead of a hard crease. The **Blend** slider sets how wide that fillet is.
- **Four modes, looping every 6 seconds:**

| Mode | What happens | The trick |
|---|---|---|
| Melt | Bot sags and flows into the floor | The floor itself is smooth-blended with the body |
| Split | Bot divides like a cell; each half keeps one eye | Two blobs smooth-blended, eyes assigned per blob |
| Swarm | Five metaballs burst out, orbit, return | Six spheres smooth-blended together |
| Morph | Sphere → rounded cube → bumpy → sphere | Distance values mixed between shapes |

## 3. Experiments

1. **Split, blend at 0.05.** The halves separate with a hard pinch. At 1.0 they stretch like taffy.
2. **Tick "Step heatmap."** Blue pixels needed few steps; yellow and red needed many. The silhouette edges burn hottest, because rays skim the surface and creep forward in tiny steps.
3. **Tick "Distance slice."** The floor shows the invisible distance field: blue inside the shape, orange outside, rings every fixed distance. You're seeing the maths the rays walk through.
4. **Untick soft shadows and AO (ambient occlusion).** The fillets flatten. Those two effects are cheap here, because the distance field tells you how "open" each point is for free.

## 4. Less obvious details

- **Soft shadows cost almost nothing.** A shadow ray tracks how close it passed to any surface. Near misses become the soft shadow edge. Meshes need far more work for this.
- **The eyes are capsules** (line segments with thickness), placed on the surface at the same spots as every earlier option. Blinking squashes space around them, so the maths deliberately under-reports distance to stay safe.
- **The bumpy shape bends the rules.** Wobbly surfaces make distances inaccurate, so the shader shrinks each step by 40% to avoid rays tunnelling through.
- **The whole scene is one shader of ~60 lines.** No vertex data, no textures. This is the demoscene tradition: entire films in 4 KB programs.

## Examples

**Sphere tracing**
```
eye ●───────────▶ ○ radius = distance to nearest surface
                  jump that far, measure again
     ●───────▶ ● ─▶ ● ─▶ •─▶ · hit (distance < 0.0008 × t)
```

**Smooth minimum (the blend)**
```
hard min(a,b):            smooth min(a,b,k):
  ◯ ◯   → two balls        ◯═◯   → bridge of width ~k
h = clamp(0.5 + 0.5·(b−a)/k, 0, 1)
d = mix(b, a, h) − k·h·(1−h)
```

**Scene function**
```
scene(p) = smoothUnion( floor(p),
                        smoothUnion(body blobs…, k),
                        fk )          ← fk grows during Melt
         then min( … , eye capsules )  ← hard edge keeps eyes crisp
returns (distance, material 0 floor · 1 body · 2 eye)
```

D. Modern real-time 3D

#15 Raymarched SDF

Share: /e/grokbot-animation/15/