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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.