Thursday, January 8, 2015

Vertex Connection and Merging

I implemented vertex connection and merging (VCM) in my renderer. VCM is an extension of bidirectional path tracing (BPT) that adds a family of biased sampling techniques. These sampling techniques form full paths by effectively fusing a light subpath vertex with an eye subpath vertex, rather than connecting the two vertices with an edge. These new merging sampling techniques are formulated in the path integral framework so that they can be combined with the existing connection sampling techniques of BPT and with each other using multiple importance sampling (MIS).

The measurement contribution function of paths created using merging is straightforward to compute. It approximates the unbiased measurement contribution function described by Veach, except that at the merging location, it uses the BSDF of the last eye subpath vertex evaluated with incoming direction determined by the last edge of the light subpath (alternatively, the direction from the last eye subpath vertex to the second last light subpath vertex could be used). The probability density of sampling the path is the probability density of the connection technique with one fewer light subpath vertices times an acceptance probability: the probability with respect to area of sampling a point on a disk with a specified radius centered at the last eye subpath vertex. This acceptance probability is computed by integrating the probability density with respect to area (or with respect to projected solid angle, as in my implementation) over that disk. For a relatively small disk, this integral can be approximated by taking the probability density with respect to area of one point in the disk multiplied by the area of the disk.

Assuming that large numbers of vertices are made available for merging, the resulting algorithm combines the strengths of BPT and photon mapping, automatically weighting the contributions of the various sampling techniques to produce the minimum amount of noise. In particular, VCM allows specular–diffuse–specular (SDS) paths to be discovered efficiently.

I also implemented a technique that allows the MIS weights to be computed efficiently using only data stored at the two vertices being connected or merged. This technique is not particularly intuitive but it can be derived mathematically. I made just a few modifications including adding support for direct sensor hits.

Below are some renders of a blue plastic ball embedded in a clear plastic ball, lit by a small bright light. Click the images to view them at full size.

BPT

VCM (equal time)

VCM, weighted merging contribution

VCM, weighted connection contribution (including direct light and sensor hits)

VCM, weighted contribution of unidirectional path tracing with direct light sampling

Below are some renders of a room lit by a lamp bounced off a mirror ceiling.

BPT

VCM (equal time)

VCM, weighted merging contribution

VCM, weighted connection contribution (including direct light and sensor hits)

VCM, weighted contribution of unidirectional path tracing with direct light sampling