Closed mmp closed 4 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).
If you can dig in at some point, that'd be fantastic. A few notes from some more digging here:
I was suspicious of the fact that SpotLight::Sample_Le() sets the ray's medium to mediumInterface.inside (rather than .outside), but it turns out that only a Medium * is passed when creating the spotlight, which it stores (confusingly) in a MediumInterface that holds the same pointer for both inside and outside. It's probably worth switching this to .outside, for clarity, but doesn't affect the images.
I tried to audit the BDPT code with this bug in mind to see if anything jumped out at me, but there wasn't anything immediately obvious.
Here's the image pyramid: (s=0 are all black since it's a spot light)
s=1, t=2:
s=2, t=1:
s=1, t=3:
s=2, t=2:
s=3, t=1:
(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.)
Just for the record: the issues that Iliyan Georgiev reported (now deleted) were due to an incorrect labeling of medium transitions in the scene.
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:
Volpath:
Diff image: