Introduction

For this project I've implemented a bidirectional path tracer using multiple importance sampling to weigh the paths as described in Eric Veach's PhD thesis.

A normal forward path tracer recursively evaluates the rendering equation using Monte Carlo integration. In order to reduce variance, forward path tracers usually evaluate direct and indirect lighting separately at each step. Practically this is implemented by evaluating the contribution at each bounce as the sum of a shadow ray and the continuation ray. Forward path are slow to converge in situations where the scene is lit mostly by indirect lighting, since the shadow rays always target a light source.

A bidirectional path tracer evaluates the path integral formulation of the rendering equation. The formulation allows each sample to be split up into a product of contributions from subpaths. One subpath is generated by tracing from the light source, another by tracing form the camera. These two subpaths are then connected in order to create the final contribution. Note that the subpaths can be connected in more than one way, the contributions for all possible contributions have to be carefully weighed in order to make sure that the resulting image remains correct. Bidirectional path converge faster than forward path tracers in scenes with difficult (indirect) lighting. They also handle caustics, pure specular reflections and refractions much better than forward path tracers, however I haven't implemented those features in this project.

Technical specifications

Shortcomings and flaws

The path tracer does not use a light image or sample implicit paths. In other words, it's a bidirectional path tracer without fancy caustics.

Some surfaces show up as black when shading normal are used, this is a direct consequence of the light-leak prevention method the project is using.

Rendered images

All images were rendered at a resolution of 1024x768. The machine used to render them was a Gigabyte P2542 laptop with the following specifications:

Enough talk. Let's get to the images!

Comparison - direct lighting

The bidirectional path tracer doesn't have a clear-cut advantage in direct lighting situations. It reduces variance, but introduces more firieflies.

Forward path tracer, 5 minute time budget

Bidirectional path tracer, 5 minute time budget

Comparison - indirect lighting

In this test, the light source is oriented towards the roof, which means that most of the light in the scene has to bounce at least once via the roof.

Forward path tracer, 5 minute time budget

Bidirectional path tracer, 5 minute time budget

Comparison - indirect lighting

In this test, the light source is underneath the table and pointing towards the floor.

Forward path tracer, 10 minute time budget

Bidirectional path tracer, 10 minute time budget

Glossy surfaces

88 samples per pixel

104 samples per pixel

Conference room

56 samples per pixel

CryTek Sponza

56 samples per pixel

24 samples per pixel