Source A · Continuous spectrum
Full-spectrum white
White
Spectrum · A small experiment in seeing
Full-spectrum white and RGB white can look the same before a prism. Spread their wavelengths across a detector wall: one makes a continuous rainbow, the other three bands.
On: brightness includes energy and eye sensitivity.
Source A · Continuous spectrum
Source B · Three narrow bands
Energy shading. On shows brightness differences from the light's energy, its spread and the modeled eye response. Off uses bright wavelength colors to reveal the full spread, with the same colors on the outgoing beam and wall. Off is an illustrative view: it normalizes brightness and suppresses the negligible tails of the narrow bands. The source spectra and light paths are unchanged.
Two physical spectra, one modeled white. Here, “RGB white” means three narrow red, green and blue wavelength bands, not an RGB transport shortcut. Their nonnegative powers are balanced to match the full spectrum’s X, Y and Z observer responses, including brightness. This is a modeled metameric pair; real observers can differ.
Color and brightness. The approximate CIE 1931 observer uses the analytic fits by Wyman, Sloan and Shirley. Both white inputs share the same display adaptation. With energy shading on, the outgoing beam and wall integrate the same finite-width wavelength samples, add their XYZ responses, and use the same exposure and brightness compression. The wall continues the beam's final column, so the arriving colors line up in either mode. Equal spectral power does not mean equal visible brightness: the observer is less sensitive at the far red and violet ends. Spectral colors outside the monitor's gamut are approximated. Showing the beam in air is a diagram, not a simulation of light scattering toward your eye. Colors inside the prism and on the relative-power charts label wavelengths; the charts are each scaled to their own peak. See the CIE definition of metameric colour stimuli.
A compact optical model. The IOR control sets the refractive index at 550 nm for both prisms; a defined synthetic dispersion curve varies that index with wavelength. The incoming beam and equilateral prism are arranged to keep every wavelength on the wall throughout both sliders' ranges. The comparison shows first transmitted paths without reflections. The main display below lets you explore reflections, refraction and more source spectra.
Check out both sources in the main display below. Move the geometry, change the spectrum, and follow the reflections and refractions.
Accumulates photons over time. Watch the rainbow pattern emerge!
Adjust sensitivity to reveal faint bands; bright bands keep their color.
Motivation:
While I was being the teaching assistant in a rendering class, I noticed most students struggling with getting refraction to work properly, although it's one of the fundamentals. This motivated me to create this demo, giving some intuition on the topic without introducing any deep theory.
Instructions:
• Click to place light source
• Drag to move objects
• Watch photons split and create rainbows through the prism
• Each photon represents a different wavelength
The useful part is the connection between a decision at an interface and the image it produces. A moving ray makes a Fresnel choice visible; accumulated sensor hits turn those choices into a distribution. The model keeps refraction, reflection and dispersion on a single inspectable plane, with simplifications stated below.
Rendering Perspective:
At every interface between materials with different refractive indices, incident light is partially reflected and partially transmitted (refracted). In this simplified model, the Fresnel equations determine the energy split between these two components. The bench uses stochastic sampling: each ray makes a probabilistic choice between reflection and refraction, weighted by the Fresnel reflectance coefficient R. With probability R, the ray reflects; with probability (1-R), it refracts. A finite set of rays gives an approximate, noisy picture of that split; the bench’s other optical and display approximations still apply.
What This Demo Shows:
Important Limitations:
This simulation significantly simplifies real optics. We treat photons as rays (no wave effects like interference or diffraction), exaggerate dispersion for visibility, and use geometric approximations throughout. Real optical phenomena involve electromagnetic wave theory, polarization, coherence, and many other effects not captured here. This demo is purely for educational visualization—not for accurate optical design.
Metamerism: Different Spectra, Same Appearance
Metamerism means different spectral distributions have the same color response for a specified observer and viewing conditions. The guided example above explicitly matches three modeled observer responses, including brightness. A prism can reveal the different wavelength distributions behind that match.
The bench detector uses the same XYZ observer model as the comparison above. Its other source presets are exploratory: the red–blue mixture is not a calibrated match to the 420 nm violet preset, and the single-yellow and green–red presets are not calibrated metamers. Use them to explore wavelength-dependent paths; full-spectrum white and RGB white are the matched pair.
Geometric Optics with Chromatic Effects:
One interesting aspect: we can demonstrate wavelength-dependent phenomena (dispersion, color) using only geometric ray tracing, without implementing full wave mechanics. The wavelength is just a parameter that affects the refractive index and perceived color. This shows the power (and limitations) of geometric optics as an approximation.