A triangular glass prism sends a narrow beam into a fan of colors. It can look as if the glass made a rainbow. The colors were already in the white light. The prism separates them by sending different wavelengths in slightly different directions.

At a boundary between air and glass, a ray changes direction. This is refraction. Snell’s law relates the angles to the refractive indices on each side. A prism has two sloping faces, so the ray refracts as it enters and again as it leaves. Those two bends turn the emerging ray away from its original path.
The second part is dispersion: a material’s refractive index can vary with wavelength. In many transparent materials, shorter visible wavelengths bend more than longer ones. Violet light therefore leaves at a slightly different angle from red. The separation can be small at the glass surface, then grow into a visible fan as the rays travel onward. The colors are not painted onto the beam; they were mixed together before they reached the prism.
Predict, then try
Predict. Open Prismatic Optics Bench by Ryan Sael. Keep the prism’s orientation and geometry fixed. The source shows a base index of 1.5168 and a Spectrum dispersion setting of 0.016. Before changing anything, predict what will happen to the colored paths if you slide only Spectrum dispersion down to zero. Will the beam stop bending, or will its colors simply stop spreading apart?
Notice. At zero dispersion, the colored paths reunite into one path. The common beam still bends at the glass; removing wavelength-dependent separation does not remove refraction. Return Spectrum dispersion to 0.016 before you change the prism’s geometry. That second comparison asks a different question, because turning the prism changes how the ray meets its faces as well as where it exits.
The difference between those two changes is the useful idea. Refraction redirects light at a boundary. Dispersion means that red, violet, and the wavelengths between them do not all follow exactly the same route through a material. A prism reveals that difference; it does not create the spectrum from nothing. In daylight, the source already contains a mixture of wavelengths for the prism to separate.
What the model shows
Prismatic Optics Bench is a visual, interactive model, not an optical-glass datasheet or a design tool. Its dispersion setting is a model control, not a measurement for a named material. Treat the colored paths as a way to see the relationship, not as calibrated engineering output. The scene is especially useful when the outgoing rays are easy to follow: on a phone, open Optics to reach the full readable ray diagram and inspector. That reveals the paths without implying that the display has measured a real prism.
Concept and interactive by Ryan Sael: Prismatic. Try it yourself: open the Prismatic Optics Bench.
Sources: OpenStax, University Physics Volume 3, Refraction; OpenStax, University Physics Volume 3, Dispersion.
Sources & further reading
Make the next question an experiment.
Browse independent creators who make big ideas visible.
Find an explainer