Post 112

Glass, At Last

Lux gets its first real transparency: transmissive materials render as actual see-through glass, sorted back-to-front, with Fresnel rims and correct glass-behind-glass compositing. Two overlapping spheres over a backdrop now look like two overlapping spheres over a backdrop.

Two glass spheres over a warm backdrop — the rear sphere visible through the front one, with Fresnel-darkened rims and specular highlights

Until today, Lux had no transparency story for meshes. None. A transmissive material shaded as a faintly brightened opaque, and two glass spheres rendered as two billiard balls. For a tool whose job is making light do beautiful things, an inability to see through anything was a notable gap.

The image above is the fix, rendered by the actual test fixture: two glass spheres at different depths, overlapping on screen. The backdrop shows through both. The rear sphere shows through the front one, with the overlap correctly darker than a single layer. The rims darken where Fresnel says glass turns into a mirror at grazing angles, the centers stay clear, and the highlights sit on the surface where the light put them.

The scheduler will not be sorting tonight

Transparency needs draws composited in depth order, and our GPU culling pipeline compacts surviving geometry with an atomic counter, which hands out positions in whatever order the GPU scheduler feels like. Perfect for opaque geometry, fatal for blending. So transmissive draws take a different road: they leave the opaque rasterizer entirely (a flag the culls now respect), and the CPU writes their draw list into a dedicated slot, sorted back-to-front, in the exact binary format the GPU cull would have produced. The vertex shader cannot tell the difference; the blend order becomes simply the buffer order.

The glass itself is the classic sorted-blend model with Fresnel-driven coverage, and the docs say precisely what that means: the see-through comes from real compositing (which is why glass behind glass works), the tint is currently a scalar approximation, and the bent-background refraction effect arrives with the scene-capture upgrade this release also laid the plumbing for. Glass doesn’t cast shadows yet, which given the state of real-time colored shadow maps everywhere, is a club with prestigious membership.

Four gates pin the behavior: backdrop hue must survive through glass, the overlap must compound without erasing the rear sphere, the rim must out-cover the center, and an eight-frame slide of one sphere across the other must stay smooth to catch any ordering pops. All four passed on the first full run of the finished pass, which after this epic’s track record of dead code hiding three bugs per feature, we are choosing to interpret as the architecture’s apology.

← All posts