Skip to the plates

Lighting reference - twelve isolated models

One ray-marcher, twelve lighting models

A single sphere-marching loop draws every scene below by stepping along each ray until it meets a signed-distance surface. Nothing here is painted: the shadows are real occlusion rays, the falloff is a true inverse square, the reflections are traced bounces, and the colored glass really attenuates light by Beer-Lambert as it passes through. Each plate silences everything but one phenomenon so you can read it on its own. Written in plain C# against the .NET base class library - no game engine, no graphics library, and no image files on this page except the frames the program rendered.

12lighting models
27 / 27self-test assertions pass
24 sto render every plate + reel
2xsupersampled, analytic normals
0external dependencies
A looping reel: one red sphere on a floor cycling through all twelve lighting models, one per second
The reference reel 12 models on one loop 820 x 560 - 2x AA ~1.15 s per model
A red sphere on a floor casting one sharp-edged shadow from a distant sun
Shadows Directional sun A distant parallel source, so the shadow has a single crisp edge - the penumbra is barely a pixel wide. This is the baseline every other shadow plate loosens. hard shadow - SunSoft 60
A green capsule whose shadow blurs wider the farther it falls from the base
Shadows Soft penumbra Give the sun an angular size and the shadow gains a penumbra that widens with distance from the caster. The soft-shadow term is folded into the same march that finds the surface. SunSoft 4.5 - penumbra grows
A row of four identical spheres dimming from left to right as one lamp recedes
Falloff Inverse-square falloff Four identical white spheres, one point lamp off to the left. Brightness drops with the square of distance, so the far sphere reads a small fraction of the near one - no artificial clamp. intensity proportional to 1 / d squared
A white sphere lit warm from the left and cool from the right, throwing an amber shadow one way and a blue shadow the other
Shadows Colored shadows A warm lamp on the left, a cool lamp on the right. Where the warm light is blocked you see only the cool light's tint, and vice versa - so a white ball throws one amber shadow and one blue one, meeting in near-black where both are occluded. warm + cool point lamps - tinted umbrae
Five gold spheres, mirror-smooth on the left grading to matte on the right
Materials Roughness sweep One gold metal, roughness stepped from zero to one across five spheres. Only the polish changes: the tight mirror highlight on the left spreads and dims into a broad matte sheen on the right, while the base color holds. gold - roughness 0.0 / 0.25 / 0.5 / 0.75 / 1.0
A gold metal sphere beside a deep-red dielectric sphere with a brightening rim
Materials Metal vs dielectric A gold conductor next to a red dielectric. The metal reflects with its own tinted response; the dielectric stays dark facing you but its rim brightens as the Fresnel term climbs toward grazing angles. conductor tint vs Schlick dielectric
A coral sphere and a pale-blue torus mirrored in a polished floor
Optics Planar reflection The floor is polished, so it takes one extra bounce. The sphere and torus appear inverted beneath them, and the mirror image fades with the Fresnel weight as your eye grazes the surface. 1-bounce - floor Reflect 0.65
A glowing white-hot sphere between two dark spheres, flickering and casting warm light and a floor reflection onto them
Emission Emissive flame The center sphere is its own light source. It reads white-hot, spills warm illumination and a soft reflection onto its two neighbors, and its emission flickers frame to frame - the only motion the physics adds, not the camera. 24 frames - self-lit, lights neighbors
Three glass panes, red green and blue, backlit and throwing matching colored patches on the floor
Transmission Stained glass The sun sits behind three tinted panes. Each pane glows its own hue and casts a matching red, green, or blue pool onto the near floor - light that carried the glass color through with it, not a decal. 3 panes - Beer-Lambert transmittance
Four panes of the same red-brown tint, each thicker and casting a deeper-colored pool than the last
Transmission Beer-Lambert depth The same tint at four growing thicknesses. Transmitted light equals exp(-absorption x thickness), so the thickest pane on the right passes the least and reads deepest - the law of absorption made visible in one row. transmittance = exp(-a x thickness)
A neutral sphere lit by a warm key, a dim cool fill, and a cool rim outlining its edge
Rigs Three-point rig The studio classic: a warm key does the modeling, a dim cool fill opens the shadow side without flattening it, and a rim from behind draws a cool line around the silhouette to peel the subject off the background. key - fill - rim
Three spheres piled on a box, with the creases where they meet darkened by contact shadow
Contact Ambient occlusion Where the spheres nest against the box and each other, less of the sky reaches the crevice, so those contact seams darken. The occlusion is sampled cheaply along the same distance field the march already built. contact darkening from the sky term