Technology

Esther 4 Engine

Our own engine, written in Rust on Vulkan. It has a ray-traced 3D renderer, a particle simulation that runs on the GPU, 3D physics for things that break, walk, pour and hang, and a 2D layer, all scheduled by one frame graph.

The short version

Nearly all of it runs as compute shaders. Physics and rendering sit in the same dispatch graph, the interface is drawn by the same pipeline as everything else, and the final image is copied straight to the swapchain.

Each pass’s reads and writes are taken from its compiled SPIR-V, so a barrier only goes in where two passes actually touch the same memory. Scratch buffers are shared between passes whose lifetimes don’t overlap.

We tune it by eye. When a published method costs more than the difference it makes on screen, we look for something cheaper that looks the same.

Language
Rust
Graphics
Vulkan 1.4, SPIR-V 1.6, ray queries with a software fallback
Physics
MLS-MPM, position-based constitutive solve, XPBD
Frames
Two in flight, no host wait inside a frame
Runs on
Windows, Linux, Steam Deck; GPUs from the last eight years
Games
Patience, Tallow

Rendering

Lighting

Hardware ray tracing

Static geometry goes into an acceleration structure that’s built once, anything that moves into a second one updated every frame, and both sit under one top level. Deforming meshes are refitted each frame and fully rebuilt every sixtieth, which keeps their bounding boxes tight. Where the GPU has opacity micromaps, rays skip the empty parts of cut-out leaves in hardware.

Global illumination

Sparse radiance probes based on Split Radiance Cascades, placed only where a visible surface needs one, on top of a world-space radiance cache that one ray in four feeds. Bounces build up over frames with no fixed limit, and over a frame it reads 0.05 to 0.12 stops darker than a path-traced reference.

Many lights

Lights are sampled in the style of MegaLights: each pixel picks one lamp per bounce from a weighted reservoir, by how much it could contribute, and traces a single shadow ray to it. Any cluster of emissive triangles in a scene counts as a lamp.

Reflections and caustics

GGX reflections with visible-normal sampling, rendered in a checkerboard above roughness 0.3. Caustics come from roughly a million photons a frame, sent from the sun toward the scene’s glass and mirrors. Dispersive glass takes one wavelength a frame, and the colour fringes build up over time.

Materials

glTF materials with their extensions: transmission, volume, clearcoat, sheen, iridescence, diffuse transmission and dispersion. Velvet uses Imageworks’ fibre sheen, hair Marschner’s three lobes in Karis’s cheaper approximations, and translucent materials a Burley diffusion profile.

The image

Lighting is done at three quarters resolution and reconstructed with temporal anti-aliasing using an adaptive Gaussian. SVGF does the denoising, with a second, faster history so moving lights don’t smear. The sky is physically based, following Hillaire 2020. Sponza at 1080p takes about 17 ms on an RTX 5070.

Without ray-tracing hardware

Every ray goes through one small interface. On a card without ray queries, the shaders walk bounding-volume trees of their own instead. The picture matches within noise. It costs more, but it runs.

Grass

A material can grow blades of real geometry around the camera. A GPU pass lays every blade into the frame each frame, one thread a blade, and the canopy bounces light like any other surface. A lawn out to 8 m costs about 2.5 ms at 1080p.

Simulation

A world made of particles

MLS-MPM

Parcels carry mass, momentum and deformation history across a background grid, each with an affine velocity so angular momentum isn’t lost in the transfer. Grid-to-particle, the constraint solve and particle-to-grid run as one fused kernel, compiled into specialised variants.

Position-based constitutive solve

Instead of integrating stress, each material defines a constraint on its deformation and the solver relaxes toward it, three iterations per substep. The step is fixed at 1/480 s with six to eight substeps a frame, and each parcel has its own advection limit rather than one for the whole world.

One solver for everything

Water and sand don’t get systems of their own. A material is one of a few models plus a row in a table: fluid, corotational elastic, cloth, Drucker-Prager granular with a return mapping, or a von Mises paste. Lava, for example, is rock with a low melting point, so it runs while it’s hot and sets into basalt.

Multi-phase grid

Each grid node keeps separate momentum and volume for solid, liquid and gas. Buoyancy is plain Archimedes for everything, applied at the centre of buoyancy so bodies tip as well as float, with added mass worked out from the wetted shape.

Rigid bodies

Reduced-coordinate bodies, with their parcels following the pose. Every pair uses the same contact law: velocity-level projected Gauss-Seidel with accumulated, clamped impulses, friction as a position constraint, and a soft overlap constraint that’s relaxed again after integration.

Light on the same grid

In the 2D world, light is solved with Holographic Radiance Cascades on the same grid the matter lives on, so sand, water and smoke all scatter and absorb it. No material has a lighting model of its own.

Simulation

In three dimensions

Things that break

Each matter is a row: how strong it is and the pattern it breaks in. Glass cracks in spokes and rings, stone and concrete into Voronoi chunks crowded at the blow, wood into splinters along its grain, and steel bends or dents. A building is chunks glued where they touch. Its weight runs down through the glue to the ground, so knocking out a column brings down what it held.

Bodies that walk

A person is fifteen rigid parts with a muscle at each joint, solved with XPBD. It walks one step at a time in the manner of SIMBICON, on its own balance. It can sprint, crouch, limp, climb onto a crate and step down a drop. When it stumbles it reaches for a wall or a table, and when it falls its hands brace for the floor.

Water and paint

Weakly compressible MLS-MPM on the GPU, drawn in screen space into the scene’s own light, with caustics, spray and foam. Thick fluids are the same particles with a viscosity and a yield. Paint carries a Kubelka-Munk pigment, so two colours mix where they are stirred.

Cloth, chains and hair

Cloth, chains, hinged signs and ragdolls are particles joined by links, solved with XPBD in sixteen substeps a frame. Cloth hangs, folds over itself and can be cut. Hair is a few hundred simulated guide strands, with thousands of drawn strands following them.

Engineering

How we check it

Deterministic

Randomness keeps no state: every random number is a hash of indices the caller already has. Where many threads add into the same place, the sum is done in scaled integers, because float addition isn’t associative and the answer would depend on which thread got there first.

Checked by laws

Rather than comparing against reference images, the build checks invariants on the GPU: every field stays finite, a closed scene keeps its mass and momentum, a sealed pool never gains energy and a dropped body falls at gravity. Over two hundred source lints make sure anything stated in more than one place says the same thing everywhere.

Headless and replayable

Any of our games can run its real frame graph without a window and take screenshots of itself. One key saves the full state plus a few seconds of input, and replaying it reports the first frame that comes out different. Most of our testing is done this way.

Declared once

Buffer layouts shared by the CPU and GPU are declared once and generated for both Rust and GLSL, and shader constants come from the same definitions the host reads. Every stage is a named region in the command stream, with breadcrumbs that survive a device loss.

The 2D stage

A whole 2D frame is drawn in one compute pass. Draws are sorted into 16-pixel tiles and each pixel is written once, blended premultiplied in linear light and dithered before quantisation. Text is rasterised at the device’s own pixel size.

Sound from the solver

Water sounds are synthesised from the air the simulation traps: the solver already counts the bubbles it makes, and that count drives the sound. We check it by its spectrum, since the build can’t listen to it.

Scenes and an editor

A level is a plain-text scene file. The engine opens one on its own with an editor beside it: pick things by clicking the picture, move them with handles, change their materials, and save. Saving from any text editor rebuilds the scene in place.

Paths and crowds

Walkers find their way by A* over a walkable grid, pulled taut into a few straight legs. Many walkers with one goal share a flow field instead, so a crowd costs little more than one.