home/ atoms/ sdf-painted-lighting

Injecting fake bounce/subsurface lighting by hand into a raymarched scene fakes realistic results without global illumination

Computing accurate global illumination (GI) in a raymarcher is expensive. IQ’s standard approach — used across Piano, Greek Temple, Ladybug, Volcanic and others — is to ‘paint’ lighting: manually inject colour into areas where bounce light or subsurface scattering should appear, driven by spatial position, rather than computing it via shadow casting or pathtracing. In the Piano image, for example, some wall light was added artificially and the window it appears to come from does not exist but was shaped by hand. Subsurface-looking effects were similarly hand-tuned. The technique is fast, controllable and art-directable, at the cost of physical accuracy — a core craft move for realtime SDF shaders where full GI is too expensive.

Examples

In a Shadertoy shader, add a term like col += 0.3 * vec3(0.8,0.5,0.3) * clamp(-nrm.y, 0.0, 1.0); to fake warm bounce light from a floor, without tracing a secondary ray.

Assessment

Explain what ‘painted lighting’ means in SDF rendering, give one example from the article, and contrast it with path-traced global illumination in terms of cost and control.

“lighting. By "painted" I mean that it wasn't computed through shadow casting or pathtracing, but that its color was injected artificially in specific”
corpus · inigo-quilez-raymarching-signed-distance-fields-article · chunk 3