|

Lighting and rendering

You cannot see objects without light, and how things are lit completely changes how they appear.

Rim lighting

Silhouette edges brighten and face-on surfaces darken, based on how directly the surface normal points at the camera.

Rim intensity is \( r = (1 - |\, n \cdot (-d) \,|)^{p} \) — bright at silhouette edges, dark face-on.

Subsurface scattering

A secondary ray marches through the shape’s interior to measure its thickness, letting thin regions glow from within. SSS is only applied to closed solid shapes (SDF shapes and Platonic duals) — scalar and moving scalar fields are open surfaces with no enclosed interior to march through.

Glow strength falls off as \( e^{-\,\text{thickness} \times \text{density}} \).

The sliders expose rim exponent, face-on fill, SSS strength, and density.

Two lights orbit the shape at different speeds — one faster, one slower — each driven by a channel of the audio. The faster light keeps a faint floor brightness so the shape stays visible even in silence. The shape cycles every five seconds.

A precomputed environment map assigns every surface point a color based on which direction its normal faces. Azimuth angle maps to hue; elevation angle maps to luminosity. At each \((H, L)\) cell the chroma is the maximum that fits inside the sRGB gamut — computed in the OKLCH perceptual color space. Two orbiting lights sculpt the shape in that color, driven by the audio.