Post 110

Seven Dead Lobes

The BSDF node stack finally reaches the GPU: clearcoat, sheen, iridescence, anisotropy, subsurface, transmission and volume parameters now produce pixels instead of compiling into a side table nobody read. Velvet rims, second highlights, brushed bands and oil-slick colours, live.

Lux has sixteen BSDF nodes. Layer a clearcoat over brushed metal, add a velvet sheen, tune the thin-film thickness: the material compiler would walk your graph, produce a complete GPU-ready material with every lobe’s parameters and feature flags packed, and then file it in a lookup table that nothing ever looked up. The renderer received a four-number preview instead: base colour, metallic, roughness, emissive. Seven shading lobes existed as shader code, node UI, and documentation, with no path between them.

One variant, two layout twins, three latent bugs

The fix sounds small: make the compiled material ride the wire itself instead of a side table, and have the shader read the full parameter set. It was small, and then bring-up found what dead code always hides. The shader kept two byte-identical copies of the material struct that the compiler considered different types, so the function that unpacks the full parameters could never have been called. Materials made only of modifier lobes, sheen with no base, inherited an alpha of zero from a zeroed struct and rendered invisible, which spent an entertaining hour disguising every other bug. And the layer-add compiler merged feature bits but dropped the second lobe’s fields, so adding sheen to a base uploaded “sheen: yes, colour: black”.

All three are fixed and pinned by tests. The first time the feature flags reached the GPU, the lobes mostly just worked: the sheen node renders the textbook velvet rim, brighter at the limb than the centre, which is the inversion a diffuse surface can’t do. Clearcoat puts its tight second highlight on a black base. Anisotropy stretches the highlight into a band that arcs around the sphere while the isotropic control stays a dot. Iridescence turns a white light into a coloured highlight. Each behaviour is now a regression gate with its own patch, asserting the shape of the effect rather than any pixel value.

Documentation now sells what’s in the box

The audit half of this work was less fun. Several BSDF nodes described physics the shader doesn’t do: total-internal-reflection bookkeeping that doesn’t exist, an Airy interference integral that’s actually a spectral tint, refraction that’s actually a Fresnel-gated brightening, and a companion node that was never built. Every description now states exactly what ships, and where a real upgrade is planned, it says that too. The fancy versions remain on the roadmap; the difference is the inspector no longer claims they already happened.

More material truth is coming in this epic: a chrome-capable reflection chain and a real transparency path are next. This release is the foundation they plug into, because now, finally, the wire carries the material.

← All posts