Open Vutshi opened 9 months ago
Slightly confusingly, this is actually bump mapping, not displacement mapping. (Which is currently only supported for plymesh
shapes--this should be fixed...)
I am almost certain that the issue is due to pbrt-v4 not using the appropriate correction factor for shading normals with adjoint light transport. (See Eric Veach's Non-symmetric Scattering in Light Transport Algorithms paper for details.) In pbrt-v3, the correction is performed here: https://github.com/mmp/pbrt-v3/blob/13d871faae88233b327d04cda24022b8bb0093ee/src/integrators/bdpt.cpp#L206.
But it is not included in pbrt-v4--here is the corresponding part of the code: https://github.com/mmp/pbrt-v4/blob/6d9d64eac7ac8ba381aa0226531c9ec368991fb4/src/pbrt/cpu/integrators.cpp#L2109.
So why not? The problem is that applying that correction can lead to high variance in many cases. So if the shading normals aren't too far off the geometric normal, not applying the correction may be preferable. You might try re-adding that functionality in pbrt-v4 (and finding the right spot in the LightPathIntegrator
and applying it there, and see if that makes things match up better.
Slightly confusingly, this is actually bump mapping, not displacement mapping.
I agree, the reason I called it displacement is that pbrt-v4 scene format uses “texture displacement” for the bump map. (Fixed the issue title)
Thank you for the suggestion, I will try it.
Best
@mmp
I tested the correction for non-symmetric scattering. It does change things slightly, but it does not address the main issue.
BDPT with correction factor
Difference between the new BDPT and old BDPT in pbrt-v4:
UPDATE: here is the diff of the source code
Bump mapping works differently for lightpath, BDPT, and path integrators. Tests are done with pbrt-v4 ffdc4982b34756363a2af2793e8d4fbf43698fee
Lightpath:![cornell_lightpath_v4](https://github.com/mmp/pbrt-v4/assets/4971779/125774a6-3bb3-4b00-a4eb-4b8ee43fd36c)
BDPT:![cornell_bdpt_v4](https://github.com/mmp/pbrt-v4/assets/4971779/0a5bb053-dd34-4437-9ace-f5f614822760)
Path:![cornell_path_v4](https://github.com/mmp/pbrt-v4/assets/4971779/a86e74f9-28a5-4353-80e0-8c335df3fe24)
Ground truth (pbrt-v3 BDPT):![cornell_bdpt_v3](https://github.com/mmp/pbrt-v4/assets/4971779/3c14dc56-bb6c-4a1a-a6ff-791ebc47ee02)
Scene is using
water-raindrop.png
(and Al_eta for v3) frombarcelona-pavilion
cornell_box.pbrt.txt cornell_box_v3.pbrt.txt