mitsuba3
mitsuba3 copied to clipboard
Emissive Volume Rendering with Emitters
This PR adds emissive event sampling in the null-scattering volpathmis
integrator for sampling the VRE and MIS for emission. It supersedes the previous PR #2
Description
Adds emissive volume support by adding a volume emitter. The interface, after discussion with @dvicini, involves adding an emitter attribute to medium which then behaves as a first class emitter (i.e. same as any other emitter).
This change requires that endpoints accept an extra floating point random number in order to sample the volume. Aside from that, some machinery for transforming a SurfaceInteraction into a MediumInteraction and vice versa was incorporated to prevent bloat in the remainder of the code - currently sampling an emitter requires passing in a SurfaceInteraction which I did not want to change.
Testing
- The updated codebase compiles with no new warnings.
- Automated python tests fail for LLVM modes for an unknown reason, I will investigate and update with a solution. Currently tests in
test_megakernel.py
fail with a segmentation error due to a missing reference to an LLVM variable - I'm open to suggestions for how to debug this. - Most python tests pass, I'm working on fixing the issues with the remaining tests.
- Generated several emission test variants in
participating_media
which the integrator renders. These will probably need a separate PR for the mitsuba resources repo - additionally, these would need reference renders to be generated. - Tested compilation for all
scalar_
,llvm_
,cuda_
single precision and double modes on both windows and ubuntu.
Checklist:
- [x] My code follows the style guidelines of this project
- [x] My changes generate no new warnings
- [x] My code also compiles for
cuda_*
andllvm_*
variants. - [x] I have commented my code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] I cleaned the commit history and removed any "Merge" commits
- [x] I give permission that the Mitsuba 2 project may redistribute my contributions under the terms of its license
Notes
- The implementation uses non-analogue probabilities as described in Monte Carlo Methods for Volumetric Light Transport Simulation for 2 reasons:
- The radiance herein is assumed to not be the product of
sigma_a
andL_e
, but rather simplyL_e
and while making the probability proportional to the radiance seems reasonable, I found that this led to fireflies in spectral modes and in fact setting the probability proportional toek::select(ek::hmean(radiance) > 0, sigma_t, 0.f)
leads to significantly better results. - The scattering probability is left proportional to
sigma_t
for the reason that when proportional tosigma_s
I was observing a reduced throughput in spectral rendering modes when the termindex_spectrum(sigma_s, channel)
was zero while non-zero for other channels.
- The radiance herein is assumed to not be the product of
What is the status of this? Looks like it didn't make its way into mitsuba 3. Are there still plans to do this?
Not yet no. I am not sure if @Microno95 is currently actively working on this. We went back and forth on the implementation but there were still some correctness issues the last time we spoke.
I unfortunately had to put this on hold for the past two months due to paper writing and getting covid twice (yay). I'll be back to working on this after SIGGRAPH, but as @dvicini said, there are correctness issues that need to be resolved first.
I'll close this as #40 now supersedes it.