The Cornell Box – A Renderer’s Rite of Pathage

When I was first learning about rendering concepts in the mid-late 90’s, the Cornell Box was a very common image encountered in books on the subject.

The original box featured in a famous series of papers at -you guessed it- Cornell University.  Researchers built an actual physical box with one wall painted green and another painted red.  They added two smaller white boxes inside, and took a photograph.  (Earlier incarnations had a blue wall instead of green, and the very first one had no boxes!)

Afterwards, they carefully measured the geometry and the surface properties of the entire setup so they could build an exact digital copy and render it.  The goal was to see if the render would match the reference photograph, and learn how to improve our rendering models.  Over the years, the box has gone through a few iterations with different goals.

At the time, this was a difficult scene to render, because the look depends heavily on diffuse inter-reflection, which can be expensive and sometimes complicated to compute.  To see why the diffuse reflections are important, let’s look at the box without them.

Without diffuse bounces, the only light rendered is the light sampled directly from the area light.  Since the light has area, the shadows are still soft.  But the fully shadowed areas are fully black.  In a real scene, light would bounce off all surfaces and illuminate the ceiling, as well as bouncing color from the colored walls onto the white cubes.  This is an effect commonly called “color bleeding”.

Cornell Box with Direct Light Only

This render of the classic Cornell Box only includes the light sampled directly from the square area light. No indirect bounces were used in this render.

In the final render, I have used a fairly naive path tracing approach.  I allowed each view ray 14 diffuse bounces, and used hundreds of Monte Carlo view ray samples for every pixel to reduce noise.  Unfortunately, this scene took two hours to render, which should not be the case.  It’s too slow.  I have a lot of optimization to do!

The Cornell Box rendered with Deluxe Render.

This render of the classic Cornell Box was made with Deluxe Render

Regardless, it’s nice to finally recreate this classic image in my own code.  I roughed in the camera by eye, so the view isn’t a perfect enough match to overlay them.  My cubes are fatter, OF COURSE.  And the Cornell colors are more saturated.  Many things could account for this color difference.  For example, their render is a multi band spectral render and mine is simple RGB.  It would be nice to eventually use the exact camera settings and the full spectral values, and see if I get a closer match.

A comparison of my Cornell Box render on the right and the 'official' Cornell jpeg on the left.

A comparison of my Cornell Box render on the right and the ‘official’ Cornell jpeg on the left. My camera back is a different aspect ratio!

Leave a Reply

Your email address will not be published. Required fields are marked *