mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.88k stars 1.19k forks source link

BDPT and volpath integrators give different results #179

Closed mmp closed 4 years ago

mmp commented 6 years ago

With the attached scene, the BDPT and volpath integrators give significantly different results: the image is 12% brighter overall with volpath; this can be easily seen in the floor area, for example.

One possible clue is that this doesn't reproduce with a point light; they match (on average) in that case.

bug.pbrt.txt

BDPT: bdpt

Volpath: volpath

Diff image: diff

wjakob commented 6 years ago

I can take a look at this, but it may take me a bit too get to it. One useful bit for debugging would be the image pyramid that can be dumped out with a separate debug flag. I suspect that one of the strategies may be losing track of the fact that we're inside a medium. (potentially related: I noticed that one "MediumInterface" line in the .pbrt file is commented out).

mmp commented 6 years ago

If you can dig in at some point, that'd be fantastic. A few notes from some more digging here:

Here's the image pyramid: (s=0 are all black since it's a spot light)

s=1, t=2: bdpt_d01_s01_t02

s=2, t=1: bdpt_d01_s02_t01

s=1, t=3: bdpt_d02_s01_t03

s=2, t=2: bdpt_d02_s02_t02

s=3, t=1: bdpt_d02_s03_t01

mmp commented 6 years ago

(Regarding that commented out MediumInterface; that has no effect, with or without it. Just a debugging experiment. I've confirmed that the rays generated by SpotLight::Sample_Le() do carry the right Medium in either case.)

wjakob commented 5 years ago

Just for the record: the issues that Iliyan Georgiev reported (now deleted) were due to an incorrect labeling of medium transitions in the scene.