Sand AISand AI MAGI-2MAGI-2 è ora su SandBase: video in 1080p con audio nativoProvalo ora

WebGPU Soft-Body Gummy Bears

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.

Esempio

Gummy Bears interactive WebGPU soft-body scene
Apri in una nuova scheda

Gummy Bears interactive WebGPU soft-body scene

L'esempio funziona in un frame isolato, senza accesso a questa pagina.

Esegui online

Eseguilo in un sandbox di SandBase e visualizza i risultati in Lab.

Apri in Lab ↗

Cosa ottieni

Bring a soft subject, its gesture choreography and an optional palette. The Skill returns a downloadable Skill, interactive demos and example videos.

Come funziona

  1. 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.

  2. 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.

  3. 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.

FAQ

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.