Lighting













This group covers the light kinds, curated rigs, and cast shadows.
| Sketch | What it shows |
|---|---|
| Lighting | The three light kinds placed by hand to shade solids: a fixed directional key, an orbiting point bulb, and a sweeping spot. A row of spheres shows rising specularSharpness. |
| LightSets | One frame, several lighting rigs. Three rooms side by side, each lit by withLights from its own fixture: a swinging warm bulb, a cold overhead strip, a green glow out of the floor. Every back wall carries the same plate drawn withoutLights, so the three walls come out warm, cold and green while the three plates come out identical. |
| LightingPresets | One call relights the whole scene. The curated LightingPresets (.standard/.threePoint/.goldenHour/.noir/.studio/.moonlight) cycle over one still life, plus a custom rig built in the sketch. Click or press a key to step. |
| Shadows | Directional cast shadows. Solids drop shadows onto a floor and onto one another through castShadows(). |
| SpotShadow | A spot light as the shadow caster. A perspective shadow map is fit to its cone, so the solids inside the beam drop crisp shadows. |
| PointShadow | A point light as an omnidirectional caster. A bulb at the center throws shadows in every direction, ray-traced on an RT GPU and through a depth cube elsewhere. |
| ManyCasters | Several casters at once. A warm key is joined by a swinging spot or by two circling point lamps, and each throws its own shadow. |
| AreaLights | Rect, disk, and tube sources shading a small studio set. The softbox grows and shrinks, and the softness of its shadows follows its size. |
| LightShaping | Photometric profiles and a projected cookie, the two ways a real fixture shapes its beam. |
| ManyLights | A courtyard at night with sixty-four drifting lamps in it. Each one is given a reach, so it lights its own corner and nothing past it, and the renderer shades a pixel against the lamps standing over it. |
| VolumetricLight | Beams, gobos, and shafts you can see in the air. |
| Caustics | The light a glass or a polished metal focuses onto what is around it. |
| GlobalIllumination | Light that bounces, so a red wall reddens what stands beside it. |
Run one with swift run Example-3D-Lighting-<Name>, for example swift run Example-3D-Lighting-Lighting.