Britannica
Sources used in this answer
How does ray tracing model reflections and refraction in a computer image?
Created from Britannica articles
using AI.
AI can make mistakes, so verify using Britannica articles.
computer graphics
The Utah Teapot, a standard graphics image used to benchmark computer systems.
In computer graphics, ray tracing is a rendering technique that simulates the behavior of light by following imaginary rays from an observation point through a scene. To model reflections and refractions, the algorithm applies fundamental optical laws whenever a ray encounters an object.1
- Reflection: When a ray strikes a surface, the algorithm calculates the path of the reflected ray based on the angle of incidence. This process is repeated recursively for each new ray until it either exits the scene or its contribution to the final image becomes negligible.1
- Refraction: When a ray passes through a boundary between two different media, its path is altered according to Snell’s law. This law dictates how light bends based on the refractive index of each medium. In practice, this is often calculated using geometric constructions where the direction of the refracted ray is determined by the ratio of the refractive indices of the two materials.23
By tracing these paths, the computer can accurately render complex visual effects like mirrors, glass, and water.1