yuphin / Lumen

A Vulkan Raytracing framework for various bidirectional path tracing techniques
MIT License
449 stars 29 forks source link

[Question] MLT integrators #15

Closed tigrazone closed 9 months ago

tigrazone commented 9 months ago

Hello. Your renderer is impressive. I have questions about MLT integrators.

  1. WHY rendered too slow and calculate something too much time for every frame
  2. SMLT is a "Selectively Metropolised Monte Carlo light transport simulation" by BENEDIKT BITTERLI and WOJCIECH JAROSZ, 2019?
  3. VCMMLT is done?
  4. Sometimes I have "Fence wait error" on my nvidia 3060
yuphin commented 9 months ago

Hi, 1 - Unlike the other algorithms, the MLT integrator does not work progressively. Basically at each pixel we perturb/replay the random seed until we hit the specified mutation count and continue with the seed that has the highest contribution to the pixel. Since this integrator builds on the BDPT integrator it's especially slow. This is mainly meant to be a reference implementation that closely follows the implementation described in PBRTv3.

2- SMLT stands for Streaming Metropolis Light Transport. The idea is that instead of building the MLT on top the BDPT integrator, which is not friendly on GPUs, we build it on top of Streaming BDPT implementation, which is basically the VCM implementation without the vertex merging. This results in significant speedup compared to the base PSSMLT.

3- The VCMMLT in turn builds the MLT algorithm on top the VCM integrator. This may require some additional parameters in the scene .json files (an example setup is in cornell_box_vcmmlt.json). The reason why it performs worse than the former is because we have to first shoot paths from the eye or light first and perturb the other. This is ultimately a limitation of a GPU implementation of this algorithm because for faster neighbor lookups I've opted to use a stochastic hashing approach rather than using Kd-trees or some other data structures. I have plans to experiment with this aspect in the future though.

4- I'm currently working on a reworked version of the GRIS integrator. Hopefully the new version will fix those.

Hopefully that answers your questions.

tigrazone commented 9 months ago

Thank you

yuphin commented 9 months ago

Regarding the fence wait error, I think this is partly because the sample time in some of the integrators take quite a bit of time. As far as I'm aware, none of the integrators should raise fence wait error since I've also used a 3060 laptop at the time of developing them. However, I've also noticed a significant slowdown of the VCM code compared to last year's drivers, so I suspect something is up in the implementation that only became apparent with the recent drivers. Therefore I've created a separate issue for that: https://github.com/yuphin/Lumen/issues/23

tigrazone commented 9 months ago

Can fence wait error off? Maybe more timeout or some flags? On bedroom scene with VCM program fails and aborted sometimes