Una scriptura, multa machina. one writing · many machines · the shader travels
GRITZ · 2010 · W3C · 2023 · FOLEY · 2024
The shader was the most authored, least portable thing in the rendering pipeline. Three languages — written by three different rooms over fifteen years — taught it how to travel. OSL stops describing what to do and starts describing what is. WGSL stops shipping to one device and starts compiling to all. Slang stops hard-coding a material and starts declaring its contract. Three abstractions, one disciplined escape from device lock-in.
For most of the discipline's history, a shader was a function written for a specific renderer. GLSL for OpenGL. HLSL for DirectX. RSL for RenderMan. The function returned a color; the function ran on one device class; the function was rewritten when the device changed. The shader was the most authored object in the pipeline, and at the same time the least portable.
The trilogy this plate concerns is the slow, incomplete escape from that condition. Each leg makes the same move at a different layer. OSL pulls the shader up one abstraction — the function no longer commits to how the surface is rendered, only to what the surface is, leaving the renderer to interrogate. WGSL pulls the shader sideways — the function commits to one source text but compiles to many backends, with the spec ratifying the translation surface. Slang pulls the shader up another abstraction — the function declares an interface, leaving the implementation as a swappable member.
The pattern is older than shading. It is the abstraction-and-translation pattern that disciplines every mature language. What is rare is for the GPU side of the pipeline to be allowed it. The shader was the last thing to escape.
Three shader languages, written by three rooms — a film studio, an open-web consortium, a GPU vendor's research lab — converging on the same discipline. Each one solves the device-lock-in problem at a different layer of the stack. Read in order, they tell the longest single argument the shading discipline has made about itself.
PRODUCTION VFXCLOSURE-RETURNING
Larry Gritz wrote OSL inside Sony Imageworks because the studios were sick of rewriting BSDFs every time they switched renderers. The shader stopped being a function that returned a color and started being a function that returned a closure — a description of one or more BSDF lobes the renderer could then interrogate three ways: SAMPLE picks an outgoing direction, EVAL measures the lobe at a direction, PDF returns sampling density. Same .oso, six renderers — Cycles, Arnold, RenderMan, Octane, V-Ray, Karma. The shader specifies what the surface is; the renderer decides how to ask. Specimen 042.
BROWSER-CLASSCROSS-COMPILE
The W3C GPU for the Web group spent five years on a single problem: a shader language that could ship on every machine the browser runs on. One source, four backends — SPIR-V (Vulkan/Linux/Android), MSL (Metal/macOS/iOS), HLSL (DirectX/Windows/Xbox), naga IR (the browser runtime). The compiler is Tint (Google) or naga (Mozilla); the translation is the spec. WGSL is also the first shader language designed to live in a sandbox: no undefined behavior, no out-of-bounds reads, no uninitialized memory — the spec forbids all three. The browser is the harshest stage, and the language was written for it. Specimen 043.
GENERIC SHADERSDIFFERENTIABLE
Tim Foley's Slang asks a question shader languages had not been allowed to ask: what if a shader could carry generics — the way Rust traits or Swift protocols do — without giving up GPU efficiency? The answer is interface IBSDF { ... } with implementations slotted at compile time. A material library becomes a set of impls; the renderer asks for one by name; the compiler specializes. And — the move that lifted Slang into the moment — the language is differentiable. Compose a shader, and the compiler will hand you back its gradient. The shader is no longer just a renderer. It's a layer in a network. Compiles to SPIR-V, DXIL, MSL, CUDA, WGSL, GLSL. Specimen 044.
Three rooms. Three years separated by long pauses — 2010, 2023, 2024. One arc. The shader stopped being tied to a renderer (OSL), then stopped being tied to a device (WGSL), then stopped being tied to a particular implementation of its math (Slang). What's left is the discipline: the shader is a description that travels.
What changed between 2010 and 2024 was not the idea of a portable shader language. The idea was old — Cg shipped in 2002, RSL was at Pixar for two decades, attempts at universal shading languages fill the SIGGRAPH archive. What changed is the substrate that makes them stick.
Three forces moved at once: open-spec bodies matured (ASWF for OSL, W3C for WGSL, Khronos for Slang) — none of these languages are owned by a single vendor; production pressure focused — film vfx for OSL, the web for WGSL, neural rendering for Slang; and GPU compilation toolchains became plural — SPIR-V crystallized as an intermediate representation everyone could target, and once SPIR-V existed, "compiles to many backends" became a tractable engineering problem rather than a research project.
The cleanest illustration is the lineage. Tim Foley starts Slang at NVIDIA Research in 2017 and ships v1 stable inside a Khronos working group seven years later. The W3C ratified WGSL after five years of negotiation between Apple, Google, Mozilla, and Microsoft. OSL spent eight years inside Sony before Imageworks open-sourced it and the Academy Software Foundation took it on. The languages survived because the institutions did.
Plate IX argued that the right answer is often older than the conditions in which it can be used. Plate X argued that the right answer is sometimes written by someone the platform hasn't hired yet. This plate argues something quieter, and more procedural.
The right answer is sometimes a discipline of restraint at the language layer. Don't write to a device; write to an idea. Don't write code that returns a color; write code that returns a closure. Don't write code that ships to one backend; write code that names the things it depends on and lets the compiler decide. Don't write a material; write its interface, then the implementations.
The shader is a description that travels. The translation surface is the language. Una scriptura, multa machina. Three rooms, fifteen years, one disciplined escape — and the shader has finally learned the move every other discipline learned a generation ago.