WebGPU Soft-Body Gummy Bears
- Lab Skill
- v0.1.0
- Interactive 3D
Four translucent gummy bears on an ivory floor, rendered with native WebGPU. A deterministic 36-second choreography stretches, presses, flips and tumbles them before they settle back to the exact rest pose. Drag any bear to stretch, squish or toss it. A fixed-step tetrahedral XPBD solver in one offline HTML.
示例
Gummy Bears interactive WebGPU soft-body scene
该示例在沙盒化的框架中运行,无法访问此页面。
在线运行
在 SandBase sandbox 中运行,并在 Lab 中查看结果。
在 Lab 中打开 ↗你将获得什么
Bring a soft subject, its gesture choreography and an optional palette. The Skill returns a downloadable Skill, interactive demos and example videos.
工作原理
- 01
Fill the Four Softies prompt
Gummy Bears fills its prompt with node scripts/fill-prompt.mjs --slots assets/prompts/examples/four-softies.json --out prompt.md, then node scripts/new-project.mjs --out my-gummies and npm ci. The body shape, cage and gesture schedule are code in src/sim.mjs, so a new subject or choreography means editing that module and rerunning the tests. Copy lives in src/i18n/strings.json.
- 02
Grab and toss a bear
Four translucent bears on an ivory floor play a seekable 36-second choreography of stretch, lift, twist, press, drop, flip, tumble, tip and recover. Press on a bear to grab the surface; nearby material follows, ears and limbs lag, and a moving release tosses it. Each bear is a 4278-tet XPBD solid stepped on the CPU in Float64 at 1/120 s, drawn with native WebGPU and WGSL.
- 03
Build, shoot and record
npm run build:single writes the single HTML, npm run shoot -- --file dist-single/index.html runs the checks and npm run record makes the film with ffmpeg and ffprobe. Node 22.4 or newer is required. The release reported zero GPU errors, zero inverted tets, no NaN values, volume staying between 0.97 and 1.02 of rest, an exact recovery and a deterministic replay.
常见问题
Does Gummy Bears need WebGPU?
Yes. Gummy Bears requires WebGPU and has no WebGL fallback. It was verified on one machine, an Apple M5 with Metal in Chrome 155. Because the solver runs on the CPU, slow machines and phones step below real time.
What do the Gummy Bears sliders change?
Gummy Bears exposes Firmness and Internal damping, which animate with the choreography and change the physics. Dragging a slider overrides it until the next keyframe. The sidebar also offers Give it a nudge, Reset, quarter speed, Show mesh for the tetrahedral cage, Pause and a sound toggle.
Is the Gummy Bears physics realistic?
Gummy Bears is partly realistic. It runs a real tetrahedral XPBD solver, but all four bears move in lockstep, the late recovery is a kinematic blend to the exact rest pose, and the mass, volume and kinetic energy readout uses illustrative units.
Can I seek the Gummy Bears choreography?
Yes. Gummy Bears steps at a fixed 1/120 s, so window.gummyDemo.renderAt(t) seeks deterministically to any time. Adding ?capture=1 turns autonomous stepping off, which is how the film is recorded frame by frame.
Does Gummy Bears call any model?
No. Gummy Bears needs no credentials, paid calls or uploads, and loads no models, fonts, images or network assets at runtime. Any model use happens only in the coding agent you choose to edit it with. Sound is optional synthesized squishes that start muted.
更多 Skills
所有 Interactive 3D Skills →
Resin Diorama
Live 3D resin-block dioramas in your browser: send a little tram across a clear turquoise sea, or ripple the bay of a cliff island. Synthesized sound, and every scene can be tuned.

3D Vehicle Worlds
Explore interactive 3D vehicle worlds in your browser, with varied terrain, camera controls and driving effects. Choose a playable example to begin.

3D Firefly Terrariums
Turn a thick glass miniature, scatter glowing fireflies and open its brass lid. Actual particles leave through the neck and return before it seals. A moonlit cabin, forest and real local lights in one offline HTML.

Jelly Candy: Fruit Bears
Six translucent fruit gummies on a white table. Grab any part and pull, lift a head until the neck stretches thin, press one flat until it springs back, flick one across the pile or pour in more. Fixed-step soft-body physics and a marching-cubes skin in one offline HTML.

Stone Stars: 3D Miniature Landmark City
Turn a city into a storybook 3D island around one landmark, with chapters, a daylight-to-starlight slider, street life and a matching scored 24-second film. Sample: a Gaudí-style basilica.

3D Architecture Night-to-Day Explorer
Turn any architectural site into a detailed 3D scene with a night-to-day light slider and a matching 20-second film. Sample: the Temple of Heaven.

