The path-traced cornellbox images so far did not use multi-sampling strategy. It solved the integral problem by domain partition, and
take only one sampling strategy for each sub domain.(i.e., s0t2, s1t2, s2t2, s2t3, s2t4 for the different sub-domains).
Because the path domain can have infinite length path, it is actually an approximate solution to the final light transport integral.
Inside this page, are images rendered with multiple importance sampling. This is basically a re-implementation of Veach's
bidirectional path tracing. Given a light sub-path, and eye-subpath, a whole group of (theorectially infinite, but actually only a few
s?t? sampling techniques will get valid sample) sampling strategies are applied simultaneously by concatenating any prefix of light subpath
with any suffix of eye subpath. Below, 'lmen' means sub light path of length m and sub eye path of lenght n.
The whole scene is the same as the previous ones, except now the camera is also specified as part of the scene so that sampling stratey of
s?t0 is allowed. I've also scaled down the whole scene to get around the problem of underflow when calculating the pdf of generated
(long) path. See scene file.
Comparison of single and multi-sampling strategy.
The left image are scaled by 30, sqrt-ed twice, while
the right one is scaled by 20, sqrt-ed once.
s2t2
l2e2
I put the above l2e2 image yesterday, and now find out a big mistake. I keep this image as a remind that Monte Carlo sampling
could be a
wrong way if not unstood correctly (and an simple and efficient way otherwise). I use power combination strategy to combine all
the multiple importance sampling used here. But the problem is, because I always sampled from a bi-path, which has fixed light
sub-path(1 edge) and fixed eye sub path(1 edge), some sampling strategy actually cannot have any sample point. These strategies
are s0t2, s0t3, s0t4, s2t0, s3t0, s4t0, s3t1, s1t3. In other words, their pdf should be
zero, which is not the case in normal coding of sampling weight computation. The image still looks ok only because all these
sampling techniques mentioned above has almost zero density compared to the others(i.e. s1t1, s1t2, s2t1, s2t2).
If the missed strategies have dominating pdfs, then we can only get a dark image (which is the case of l0e3). And if they have
significant pdf, then we will get a wrong image, as l1e2 below(the problem is s2t1 has comparable pdf with s1t2, while it
has not sample point).
multi-sampling from l1e2
Finally, here are some images rendered by multiple importance sampling from bi-directional paths, where path of any
length have some probability to be sampled. So, contrast to all the images in prevous pages, these images are the full solution
to the light transport integral problem.
These three images show that the probability to terminate (after the first 3 vertices in this experiment) the light or eye
subpath is strongly related to the variance. And it seeems the larger the worse.
terminate_prob = 0.8
terminate_prob = 0.5
terminate_prob = 0.1
The following three images are rendered with these parameters.
After the first three vertices of each subpath, randomly terminate with probability of 1- albedo of the surface.
Sample weight is computed as w(i) = p(i)^2 / Sum p(j)^2.
The first image below has some obvious dark spot (a quite high 20X20 sample per pixel is used). I am not sure whether it is
due to variance or some bug in my code. I once thought that this is perhaps caused by the high variance sampling strategies of
s0t? and s?t0. (For the diffuse cornellbox scene, they are really bad sampling techniques).
So I rendered three more images using all pdfs without these two, with 5X5, 10X10, 20X20 samples per pixel.
But the dark spot still exist, so I only put two of them with different smaples here. All these images are scaled by 20,
and square-root-ed once, the same as before. However, compared with path-traced image of finite lenght(<6), the images
here look brighter. I am not sure whether this is due to the difference between full solution and partial solution,
or some bug in my code.