Ray tracing is a technique for generating realistic 2D images of 3D scenes. It models the movement of light by casting rays backwards from an imaginary camera into the 3D scene. When the ray collides with an object, the colour of that object at that point determines the colour that reaches the camera.


This series of visual experiments ignores the imaginary camera and instead, visualizes rays of light emanating from light sources in a 2D scene. The rays of light bounce off random arrangements of rectangles and ellipses. Sometimes the light is absorbed, other times it reflects or refracts, creating unusual patterns of shadow and light.













Future Directions #
Drawing a line to represent each ray of light has significant downsides. First, the area close to the light source appears very bright and has a high density of rays whereas the area further away is dark, with a low density. The low density areas don’t make a good representation of lighting in the area and aren’t visually appealing. In fact, a lot of these images look much better at a small scale than zoomed in.
The second issue is the moiré artifacts that occur regularly throughout these images.
Drawing more lines becomes computationally expensive and only magnifies the first problem. Instead, iterating through each pixel of the output image and determining the rays which affect it could produce more compelling results.
Another interesting idea would be to visualize the light not as solid lines but as waves. If each line varied between light and dark over some wavelength then really interesting interference patterns could form where the rays overlap.