Neuroanatomy · WebGPU · Raymarched
A human brain raymarched live on your GPU: its folded cortex lit up lobe by lobe, signals racing along the white-matter tracts, and a cut that shows grey matter wrapped over white. Pick a task and watch which regions light up.
The wrinkled outer layer is the cerebral cortex, and two deep grooves divide it into lobes. The central sulcus runs from the crown down toward each ear. In front of it is the motor cortex, which sends movement commands. Behind it is the somatosensory cortex, which receives touch. Wilder Penfield mapped both strips in the 1930s by stimulating patients' brains during surgery. Each strip holds a distorted map of the body, with huge hands and lips. The lateral fissure separates the temporal lobe below it from the frontal and parietal lobes above it.
Two small areas on the left side are named after the doctors who linked them to language. Paul Broca found that damage near the back of the frontal lobe left patients understanding speech but barely able to produce it. Carl Wernicke found the opposite near the back of the temporal lobe: fluent speech that made little sense. In most people language sits mainly in the left hemisphere, so the model only marks them there. Turn the brain round to find them.
Tucked under the back is the cerebellum. It is a tenth of the brain's volume but holds about 80 percent of its 86 billion neurons, packed into the fine folds you can see. The brainstem below it keeps you breathing.
Pick a task and the regions most associated with it light up. Signals then run along the main white-matter tracts, the bundles of insulated nerve fibres that carry them. Switch to X-ray to see them. Moving sends traffic down the corticospinal tract to the brainstem and loops it through the cerebellum. Seeing runs the optic radiation from deep in the brain back to the visual cortex. Speakinglights the arcuate fasciculus, which arches from Broca's area over to Wernicke's. The three arcs crossing the middle are the corpus callosum, the bridge between the two hemispheres.
Choose Cross-section and slide the cut through the brain. The cortex shows as a thin coloured rind, about 2.5 millimetres thick, which is about right for a real brain. It follows every fold. Underneath is the white matter, which is mostly wiring. Folding is how a sheet of cortex the size of a large napkin fits inside a skull.
There is no 3D mesh here. The brain is a signed distance field: a formula that gives, for any point in space, how far it is from the brain's surface. The formula is a few ellipsoids blended together, carved with the two fissures and wrinkled with layered noise for the folds. For every pixel, the GPU steps a ray forward by that distance until it touches the surface. This is called sphere tracing, and the same formula then gives the lighting, the region outlines and the cut. The X-ray look instead collects light all the way through, so the folds on the far side glow too.
The signals are about 48,000 particles moved by a WebGPU compute shader. They travel faster along tracts whose regions are busier. Clicking a region asks the GPU the same question for the single ray under the pointer.