Having fun with Mirrors and Raytracers

Written by Paul Bourke
October 1997

Question: What happens inside a room with one light source and perfectly mirrored walls?


In what follows the standard geometric arrangement as shown below will be used. A cubic room, one light source to the left of the camera, a red cross made of reflective cylinders, and a blue reflective sphere in the center.

The walls are turned into perfectly reflective surfaces, at least as perfect as the traditional raytracing software (StrataStudio) being used would allow.

Obviously since there is some loss at the interface the surfaces are not perfect reflectors.

The second thing to note when rendering such a scene with highly reflective surfaces is that raytracers don't follow rays "forever". Normally the software stops considering a ray after a certain number of bounces (intersections) with objects. This is perfectly reasonable with common non reflective surfaces but not in this example. Typically, the default number of bounces is only 2 or 3, the previous image is a rendering of the scene with only a few bounces being considered. The effect is that it appears we have an adjacent room at each wall, we should have an infinite progression of virtual rooms!

By comparison, consider the same rendering but with a much higher number of bounces, 10 in this case. As expected, such renderings take significantly longer to compute.

Switching now to software which supports more realistic surface behaviour, namely Radiance. In the next 3 renderings the wall surfaces are varied from shiny metal into a perfect mirror. In all three cases the maximum number of bounces is 100.

And finally, madness






PCS - Plane, Cylinder, Sphere

Inspired/discovered by Luc Benard

Renderings by Paul Bourke
December 2004

See also: Wada basin fractals


The renderings here are created using a ray tracing package, in this case PovRay, and the simple geometry (shown above) consisting of a plane, a single cylinder, and a sphere. The three primitives are made highly reflective and the virtual camera inspects the gap between the sphere/cylinder pair and the plane. The variation in the renderings below is achieved by adjusting the colours of the three surfaces as well as the colour and number of light sources.

The ring of bright light acts like an attractor, that is, it is insensitive to the positions of the light sources illuminating the scene.

The following PovRay model [pcs.pov] can be used as the basis for exploration by the reader.


Space Mesh

Fabric of inner and outer space
November 2004



Raw grid


Addition of galaxy background


Addition of MRI volumetric data