Add prbvolpath_sm: new unbiased differentiable volume integrator with sample matching - #1939
Add prbvolpath_sm: new unbiased differentiable volume integrator with sample matching#1939AuroraRyan0301 wants to merge 2 commits into
Conversation
4b1d38f to
e667d40
Compare
|
Hello Ruihan, thank you for this PR. I am excited to ship this feature as part of Mitsuba. However, there are some aspects of the current realization in a PR that will need further work:
Best, |
e667d40 to
5154712
Compare
|
Hi Wenzel, Thanks for the feedback, and sorry for the late reply. I apologize for leaving so much AI-generated content in the PR. I just wanted to get the discussion about the PR and its design started quickly. While porting the implementation to Mitsuba 3.9, I mainly focused on supporting a broad range of variants, including spectral rendering, and achieving good performance. I have now split out the features and simplified the commits and PR description. I have also removed the supergrid functionality for now, since making it compatible with Eradiate seems to require substantial changes to the interface. I hope the revised code is closer to the project's quality standards. Thanks again for your time and support. Best, |
prbvolpath_sm merges the transmittance and scattering terms of the DRTE to reduce the variance of the extinction grid's gradient in the optimization. Primal rendering stays the same as prbvolpath. The adjoint pass runs as two kernels: the replay loop writes one record per segment and a second kernel traces the gradient samples of the recorded segments.
5abe29d to
679d021
Compare
This PR adds
prbvolpath_sm, a volumetric integrator that estimates extinction gradients with sample matching.Denser media scatter more light toward the camera and also block more of the light passing through. These two terms of the extinction gradient have opposite signs.
prbvolpathestimates them at unrelated points;prbvolpath_smestimates both at the same points on each path segment, which cancels most of the variance. The primal image is the same asprbvolpath; all changes are in the adjoint pass.The adjoint pass runs as two kernels. The path replay loop writes one record per segment, and a second kernel reads the records and traces new rays for the gradient samples.
segment_slotssets how many records a path may keep. Any number of slots is unbiased. By default it ismax_depth + 1, so every segment gets a record. With one slot, a path keeps a single segment chosen by weighted reservoir sampling; this setting is also registered asprbvolpath_sm_linear, and the default asprbvolpath_sm_quad.Spectral variants and extinction that varies across channels are supported. Polarized variants and forward mode are not, same as
prbvolpath.Testing
Bunny cloud, one A40, 8000 iterations. PSNR is measured on the held-out view at 256 spp:
prbvolpathprbvolpath_sm_linearprbvolpath_sm_quad(default)Gradients agree with finite differences within 1% in RGB and spectral variants. The test suite passes on
cuda_ad_rgb,cuda_ad_spectral,llvm_ad_rgbandllvm_ad_spectral.Checklist
cuda_*andllvm_*variants. If you can't test this, please leave below