DriftEngine
Examples
Every example in the engine's repository: a complete program for one capability, running in its page on WebGPU where your browser has it.
-
Agents
Villagers whose routines shelter from the rain and resume, and a crier who asks a model.
-
Light in the air
A sunbeam through a window, fire and smoke, and a medium that fills the room.
-
Animation
A figure walking a circle on a blend tree, reaching for a lantern, its pace set in DriftScript.
-
Antialiasing
sceneSamplesat 1 and at 4, on the edges where the difference is visible. -
Audio
A courtyard heard from the camera: a scripted bell, a muffled cart, lanterns on the kick.
-
DriftCapture
A synthesised clip of a room fused into a surface, proposed as entities, that balls land on.
-
Characters
A character controller in a valley of steps, a slab, a bridge and a pond.
-
Chemistry
A campfire where everything heats at its own rate, with rain, wind and green wood scripted.
-
Cinematic
A buggy and a jump, cut by a scripted director, a cinematic as data, and a keyed path.
-
Display
A video settings screen drawn from what the host says it can do, and why where it cannot.
-
DriftLight
Seven hundred candles, the sixteen nearest shaded exactly and the rest summed by DriftLight.
-
DriftRay
Bounced light traced on the GPU, following a wall that changes colour. WebGPU.
-
DriftTexture
Materials as programs decoded per pixel, one animated by the simulation's clock. WebGPU.
-
DriftTR
The scene drawn smaller and rebuilt to full size by temporal reconstruction. WebGPU.
-
Entities
Frogs catching fireflies over a pond, every rule a DriftScript system, with time that rewinds.
-
Your first game
A complete 3D game: physics, a character, shadows, sound, a HUD, and its rules in DriftScript.
-
A 2D game
A whole game — paddle, ball, bricks, score, lives, win and loss — laid out in the XY plane.
-
A garment on a skeleton
A figure walking a circle in a cape: skinned cloth on the device, and a finer mesh bound to it.
-
GPU-driven pipeline
2,500 meshes culled and drawn by the GPU-driven pipeline. WebGPU.
-
Hierarchical detail
A city of 144 blocks drawn at the level of detail each one's distance deserves, crossfaded.
-
Input
A puck driven by keys, a gamepad or a thumb, a controls screen that rebinds, and rumble.
-
Instancing
Ten thousand rocks in culled batches, and a batch rewritten every frame.
-
Interface
A pause menu and options over a running scene: laid out, themed, clipped, in DriftScript.
-
Joints
A bridge of hinged planks, a door on a motor, a swinging lamp and a breakable chain.
-
Worlds from a kit
A street built from copies of three pieces, as placements and expanded, with rules in a script.
-
A room lit by a lightmap
A room lit by a bake: a page read at each surface's second coordinates, and a shadow in it.
-
Lights
Lamps that cast, a spot with a cookie, a photometric profile and a window that is an area light.
-
World-space lines
Strokes with width in metres, an antialiased edge, and a buffer rewritten in place.
-
Colour and motion
Exposure, a colour grade, vignette, grain, a fade, depth of field and motion blur.
-
Materials
Image maps built in code, metalness and roughness, and the per-draw surface dials.
-
Models
A turntable that reads glTF, OBJ and STL in a worker and streams them, or a model you drop.
-
Navigation
Villagers walking lanes in DriftScript, and dogs crossing a square on a mesh built from it.
-
Netplay
Two players in one match over a lossy link, rewinding when a guess was wrong, staying in step.
-
2D overlay and text
Screen-space panels and the built-in font, a keycap prompt, and a portrait in a box of its own.
-
Particles
Sparks, smoke and motes from pools, emitted deterministically.
-
Physics
A wall of crates, a ramp of rolling shapes, and a cannon scripted in DriftScript.
-
Picking
Hover and click: what is under the pointer.
-
Ambient occlusion and bloom
Ambient occlusion, bloom, and the two settings bloom is useless without.
-
Queries and colliders
A laser casting rays, a sensor counting what stands on it, and a kinematic wall.
-
Ragdolls and cloth
A ragdoll shoved down the stairs, a flag in a gusting wind, and a sheet dropped over a crate.
-
Recording
A still, a clip recorded as it plays, and one rendered frame by frame with its score.
-
Saves
A garden bed that saves to a server that can fail, loads across a change, and keeps preferences.
-
Writable textures
A wall a scripted turret scorches, with a clock that runs backwards and burns the marks again.
-
Sky and atmosphere
A day in ninety seconds: sun, moon, stars, clouds, and lamps that come on at dusk.
-
Procedural solids
A gatehouse built from closed solids, with windows and a doorway cut by booleans.
-
Gaussian splats
A rock garden of Gaussian splats, sorted off the frame, with geometry standing in it.
-
Sprites
A tilemap garden and a gardener who picks its flowers, one sprite pass, in DriftScript.
-
Hello world
A lit cube turning at a rate a DriftScript rule sets. The one to copy out to start a game.
-
Streaming a large world
A town far from the origin, streamed in cells by prediction, with walkers that freeze and thaw.
-
Terrain
A valley drawn as a clipmap, painted and planted by rules in DriftScript.
-
Tools
An inspector, a console and a profiler over a running game, and edits that undo.
-
Vehicles
A raycast car on a ring of cones, driven by a DriftScript driver or by you, on tarmac or ice.
-
Water
The open sea under three winds, a planar reflection, and caustics under a pier.
-
Fog and weather
Fog, one wind, rain, lightning and puddles that mirror the street.
-
XR
A headset across a room: its head, controllers and hand read each frame, a lamp on the trigger.