SUSU / PORTFOLIO
All work返回作品

Solo · MIT · WebGL Zen Simulation独立 · MIT · WebGL 禅意模拟

Robot Karesansui

R3F · WebGL · Shader Simulation · Systems Toy

A small robot perpetually rakes ripple patterns into a dry zen garden. I built it to find out how much living, self-running atmosphere one designer can compose entirely in shaders — no textures, no imported models, just simulation and state machines. 一个小机器人不停在枯山水里耙出波纹。我做它,是想知道:一个设计师,只用 shader 能营造出多少"活的、自运转的"氛围——没有贴图、没有导入模型,只有模拟和状态机。

Design Goal设计目标

Make a calm, autonomous scene that feels alive without a single imported asset. Every grain of sand, ripple, and creature is drawn procedurally and driven by its own state — the system, not the player, keeps it moving.

做一个平静、能自己运转、却感觉"活着"的场景,且不导入任何资源。每一粒沙、每一道波纹、每一只生物都程序化绘制、由各自的状态驱动——让系统而不是玩家来维持它的运转。

The System Loop系统循环

Rake the garden → battery drains → a two-leg approach back to the dock to recharge → day rolls into night → weather shifts through rain tiers → fauna come and go → the grooves slowly fade and the cycle begins again.

耙园 → 电量下降 → 两段式归坞充电 → 白天转入夜晚 → 天气在不同雨势间切换 → 生物来去 → 凹痕缓慢消退,循环重新开始。

🔧 The Build🔧 程序实现

The core is a heightfield sand simulation (1024×1024) with diffusion and drift; the rake teeth etch real grooves into the field that slowly relax back to flat. The robot follows a pre-computed Catmull-Rom path aligned pixel-for-pixel with the shader's concentric ripples, so its motion and the visible pattern always agree. A battery FSM handles a two-leg dock approach; a 3-minute day/night cycle and a weather state machine with three rain tiers keep the mood shifting. The whole thing is ~5k lines of TypeScript in a single-page R3F scene, with zero asset pipeline — everything is in-shader except the ambient audio, which is synthesised through the Web Audio API.

核心是一套 1024×1024 的 heightfield 沙地模拟,带扩散与漂移;耙齿在高度场上刻出真实凹痕,再缓慢松弛回平。机器人沿预计算的 Catmull-Rom 路径行进,与 shader 的同心波纹逐像素对齐,所以它的运动和画面里的纹路始终一致。电量状态机负责两段式归坞;3 分钟昼夜循环与含三档雨势的天气状态机让氛围持续变化。整体约 5k 行 TypeScript,单页 R3F 场景,资源管线——除环境音由 Web Audio API 合成外,全部在 shader 里绘制。

🎯 The Detail That Sells It🎯 让它可信的细节

Atmosphere lives in the small life on top of the system. Eight fauna species — dragonfly, gecko, frog, sparrow, beetle, butterfly, fireflies, and falling leaves — drift through on their own timers, so the garden never reads as static or as a busy screensaver. The tuning work was pacing: how often weather turns, how long night lasts, how quickly grooves fade — enough change to feel alive, slow enough to stay calm.

氛围来自系统之上那些"小生命"。八种生物——蜻蜓、壁虎、青蛙、麻雀、甲虫、蝴蝶、萤火虫、落叶——各按自己的节拍出现,让花园既不显得呆板,也不像忙乱的屏保。调优主要是节奏:天气多久变一次、夜晚多长、凹痕多快消退——变化要足够"活",又要慢到足够"静"。

Role角色

Solo — simulation engine, shaders, robot FSM, synthesised audio.

独立 — 模拟引擎、shader、机器人状态机、合成音频。

Scale规模

~5k LOC TypeScript · single-page R3F scene · zero asset pipeline.

约 5k 行 TypeScript · 单页 R3F 场景 · 零资源管线。

Stack技术栈

Vite · React 18 · TypeScript · Three.js (R3F + drei) · zustand · Web Audio API