Play

Experiments in making games with TypeScript & WebGPU.

Fundamentals

Real-time rendering

Shadow Mapping

webgpu / 3d / rendering

Real-time shadows cast by first rendering the scene from the sun's view to learn what it can see, so pillars hidden from the light fall into shadow; drag to orbit the camera.

PBR

webgpu / 3d / rendering

A grid of spheres lit with physically-based shading, sweeping from metal to non-metal up the rows and from a tight mirror glint to a broad soft sheen across the columns; drag to orbit.

Deferred Shading

webgpu / rendering / 3d

Drawing the scene's colour, surface direction, and position once, then lighting it afterwards in a single screen pass, so 64 moving coloured lights cost the same no matter how much geometry there is; drag to orbit.

Clustered Lighting

webgpu / rendering / compute

Lighting a scene with hundreds of moving lights efficiently by splitting the screen into tiles and giving each tile only the lights that reach it, shown as a heatmap of lights per tile; drag to gather the lights toward the cursor.

Ambient Occlusion

webgpu / rendering / 3d

Soft contact shadows in the nooks and crevices of a scene, computed by asking how much of the open sky each spot can actually see — corners see less, so they darken.

Screen-Space Reflections

webgpu / rendering / 3d

Mirror reflections built entirely from what's already on screen — each reflective spot traces a ray across the image to find what it should show, so the reflection fades away at the edges where there's nothing left to borrow.

Volumetric Light

webgpu / rendering / 3d

God-ray shafts streaming between pillars, made by letting sunlight glow through fog only where its path to the sun is clear and leaving the shadowed haze dark; drag to orbit.

Radiance Cascades

webgpu / rendering / 2d

Soft 2D lighting where every pixel fans out rays and averages the coloured light that reaches it, so glowing discs cast soft shadows and blend where their pools overlap; drag to move a light.

Post-Processing

webgpu / rendering / post-processing

Glowing orbs given a soft camera-lens bloom by pulling out the brightest pixels, blurring them, and adding the haze back over the scene — take the chain apart with the toggles; drag to orbit.

Ray tracing & ray marching

Noise & patterns

Terrain & erosion

Waves & water

Sky, fire & light

Vegetation

Cities & levels

Rigid & articulated bodies

Soft bodies & cloth

Fluids

Stable Fluids

webgpu / compute / simulation

A real-time 2D fluid that carries coloured dye through a swirling flow, curling and mixing like smoke in water; drag to stir and inject dye.

FLIP Fluid

webgpu / compute / simulation

Thousands of particles act as a body of water that's dropped in, churns, and settles, kept from compressing so it sloshes and splashes like the real thing; drag to shove the liquid around.

DFSPH Fluid

webgpu / compute / simulation

Thousands of tiny particles behaving like real water that falls, pools, sloshes and splashes with genuine weight, each one nudged by its neighbours to keep the fluid from compressing; drag through it to stir.

Lattice-Boltzmann Fluid

webgpu / compute / simulation

Fluid flowing past a cylinder, where a simple local rule in every cell builds up real flow and a steady wake breaks into a trail of alternating swirling vortices; drag the cylinder and watch the wake re-form behind it.

Smoke

webgpu / simulation / fluid

Smoke simulated on a grid, where heat lifts a rising plume and an incompressible flow makes it curl and roll instead of just blurring; drag to push the smoke around.

3D Smoke

webgpu / compute / 3d

Smoke simulated in a full 3D volume, rising and swirling from a hot source, then drawn by tracing a ray through the haze per pixel so deeper plumes read as thicker; drag to orbit the camera.

Fluid Paint

webgpu / simulation / fluid

Paint with a real-time fluid: each stroke injects colour and a push of flow, so the dyes billow and marble together; drag to paint, or leave it alone and swirling emitters keep it alive.

Particle systems

Characters & animation

Flocking & agents

Cellular automata & artificial life

Game of Life

webgpu / simulation / 2d

Conway's Game of Life — cells live or die by how many neighbours they have, and gliders and oscillators emerge from one simple rule, leaving fading trails of where life has been; drag to paint living cells.

Falling Sand

webgpu / compute / simulation

A pixel sandbox where sand piles up, water spreads and levels out, and walls stay put — each grain following simple local rules; drag to pour the chosen material.

Reaction-Diffusion

webgpu / compute / simulation

Two chemicals spreading and reacting, where tiny changes to how fast each is fed and removed grow spots, stripes, mazes or coral from a few seeds; drag to paint new growth.

Lenia

webgpu / simulation / procedural

Conway's Game of Life made smooth and continuous, so soft, life-like colonies grow, drift and dissolve instead of blinking on and off; drag to paint living cells.

Neural Cellular Automata

webgpu / simulation / 2d

Every cell senses its neighbours and runs the same tiny shared network to update itself, so a single seed self-organises into a pattern that heals and regrows where you damage it; drag to paint and seed cells.

Slime Mold

webgpu / compute / simulation

Tens of thousands of tiny agents that each follow and reinforce the scent trail ahead, weaving on their own into branching networks with no leader; drag to drop a lure they swarm toward.

Diffusion-Limited Aggregation

webgpu / simulation / 2d

Wandering particles drift until they touch the cluster and freeze, growing the branching, self-similar shapes seen in frost, coral, and mineral deposits; drag to paint your own frozen seeds for new branches to grow on.