Jelly world
A ray-marched jelly slider on a tray, until a critter pulls the lever and a candy world grows around it.
- dynamicResolution
- profiler
- baker
- font
Building blocks for TypeGPU.
Interchangeable by design. Use what you want and fill the gaps with your own code.
npm i @typegpu/kitThe kit draws the frame on the right. Scroll to see it built.
The stack is built again a module at a time, from the bottom up.
The stack is whole. Drag a number, or click a plate or a module's name to take it out.
Each code block adds a module to this flock. With WebGPU, the stack beside it shows each module's output.
const birds = table.create(root, Bird, { capacity: CAPACITY });
const rows = Array.from({ length: }, () => birds.add(bornAt()));const cells = grid.create(root, {
...birds.live(), low: LOW, size: AIR, sight: 1.4, item: Seen,
position: Bird.position.pipe(birds.inject()),
itemOf: seenOf.pipe(birds.inject()),
});
const steering = createSteering(root, birds, cells, {
sight: , rules: { flock, orbit, huddle },
});const shadow = {
size: 1024, extent: 20, filter: 4, enabled: () => has('shadow'),
} as const;
const sunDirection = degreesUp();const lamps = createLamps(root, birds, {
range: , intensity: ,
});
const light = lighting.create(root, {
settings: { ...LIT, sunDirection },
shadow,
points: { light: lamps.light, candidates: cells.candidates() },
});const scene = passes
.create(root, screen, { hdr: passes.color, normals, depth: passes.depth }, {
clear: [0.01, 0.011, 0.013, 1], label: 'scene',
})
.pipe(view.inject())
.pipe(light.inject());
const chevrons = birdsDrawing(root, birds, lamps, { length: });
const shown = [scene.add(groundDrawing(30)), scene.add(chevrons)];
const cast = [light.shadow.add(chevrons)];const glow = bloom.create(root, {
source: () => screen.textures.hdr, levels: 5, bright: lampGlow,
settings: { threshold: , knee: 0.4 },
});const print = dither(root, { cell: , levels: });
const final = finish.create(root, {
format: 'rgba8unorm', source: () => screen.textures.hdr,
glow,
grade: print.grade,
settings: { glowIntensity: , vignette: 0.25, dither: 0 },
});TypeGPU Kit provides GPU modules in one package, @typegpu/kit. It uses TypeGPU in WebGPU browsers and React Native. Each module borrows your root and records into the passes you give it. You own the loop, frame and canvas. How the kit works sets it beside plain WebGPU and TypeGPU.
The steering takes a 'use gpu' function that computes force from a bird and its neighbours. Pick a rule and drag its number.Pick one to read it.
// Separate from nearby birds, align and move towards the flock
const flock = (me: Seen, near: Near) => {
'use gpu';
const along = near.heading - me.velocity;
const toward = near.centre * ;
return near.away * 1.1 + along + toward + airAt(me) * 1.6;
};// Follow a ring and avoid nearby birds
const orbit = (me: Seen, near: Near) => {
'use gpu';
const out = d.vec3f(me.position.x, 0, me.position.z);
const from = std.max(std.length(out), 1e-3);
const around = d.vec3f(-out.z, 0, out.x) / from;
const back = (out / from) * (( - from) * 3);
return (around * 4 - me.velocity) * 2 + back + near.away;
};// Slow down near neighbours and move towards them
const huddle = (me: Seen, near: Near) => {
'use gpu';
const crowded = std.saturate(near.mates / );
const wanted = airAt(me) * (4 * (1 - crowded));
const closer = near.centre * (crowded * 3);
return (wanted - me.velocity) * 2 + closer + near.away * 0.6;
};const steering = createSteering(root, birds, cells, { rules: { flock } });Point at a module to see the modules it takes and the modules that take it. A dotted line means the taken module also fills accessors in the taker's shaders.
A ray-marched jelly slider on a tray, until a critter pulls the lever and a candy world grows around it.
Blender's Classroom, its daylight and lamps baked on a second uv set, sunbeams through its dust.
Sand, water and lava falling cell by cell through a cave lit by its own glow.
A near gale at dusk: FFT waves, foam on the crests and a low sun under the deck.
Incense smoke curls from a swinging censer, simulated and lit on the GPU.
Every example opens full-screen and includes a GPU debug panel.
A software company built around improving developer experience and bringing the innovative ideas of our clients to life. Do you have a software project we can help you with?
Hire us© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.