Each ray will hit or miss geometry within the scene, based on the idea that two points in space are said to be visible to each other if the line segment that joins them does not intersect any obstacles.
When a ray hits an object, three things can happen:
1. Reflect. Reflected light bounces off the object’s surface like a mirror.
2. Refract. Refracted light passes through transparent objects, like glass for example.
3. Be absorbed. Absorbed light doesn’t continue further in the scene.
When rays interact with objects, they collect information about the visual appearance of the object, including color, texture, and lighting of those objects. This intersection point returns a color based on:
1. How much light touches the object’s surface.
2. The direction of light touching the object.
3. The object’s surface properties.
4. The position of the observer (camera).
By performing this process simultaneously for every pixel making up the raster image of the scene, highly realistic graphics are possible. That said, ray tracing can be computationally intensive, especially in a world where games can be played in 4k resolution—that’s over eight million visible pixels in a scene.