[Bf-blender-cvs] [d0adc07d327] soc-2022-many-lights-sampling: Cleanup: fix outdated comment, add note about alternatives

Brecht Van Lommel noreply at git.blender.org
Mon Nov 7 19:10:38 CET 2022


Commit: d0adc07d3276ec361273b73b8273bcd65a2acc6e
Author: Brecht Van Lommel
Date:   Mon Nov 7 19:09:46 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBd0adc07d3276ec361273b73b8273bcd65a2acc6e

Cleanup: fix outdated comment, add note about alternatives

===================================================================

M	intern/cycles/kernel/integrator/shade_volume.h

===================================================================

diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h
index 90c0fb557b1..daaf480e8c1 100644
--- a/intern/cycles/kernel/integrator/shade_volume.h
+++ b/intern/cycles/kernel/integrator/shade_volume.h
@@ -738,11 +738,16 @@ ccl_device_forceinline void integrate_volume_direct_light(
     return;
   }
 
-  /* Sample position on the same light again, now from the shading
-   * point where we scattered.
+  /* Sample position on the same light again, now from the shading point where we scattered.
    *
-   * TODO: decorrelate random numbers and use light_sample_new_position to
-   * avoid resampling the CDF. */
+   * Note that this means we sample the light three twice when equiangular sampling is used.
+   * We could consider sampling the light tree just once and use the same light position again.
+   *
+   * This would make the PDFs for MIS weights more complicated due to having to account for
+   * both distance/equiangular and direct/indirect light sampling, but could be more accurate.
+   * Additionally we could end up behind the light or outside a spot light cone, which might
+   * waste a sample. Though on the other hand it would be possible to prevent that with
+   * equiangular sampling restricted to a smaller sub-segment where the light has influence. */
   {
     const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
     const uint bounce = INTEGRATOR_STATE(state, path, bounce);



More information about the Bf-blender-cvs mailing list