Commit: 581f0b2ce7ff821b89b73a507f865a5b56a2cecb
Author: Brecht Van Lommel
Date:   Wed Sep 21 21:11:20 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rB581f0b2ce7ff821b89b73a507f865a5b56a2cecb

Fix crash with directly visible volume emission

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

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

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

diff --git a/intern/cycles/kernel/integrator/guiding.h 
b/intern/cycles/kernel/integrator/guiding.h
index eaa73acf72d..c2bb0a8a505 100644
--- a/intern/cycles/kernel/integrator/guiding.h
+++ b/intern/cycles/kernel/integrator/guiding.h
@@ -288,10 +288,12 @@ ccl_device_forceinline void 
guiding_record_volume_emission(KernelGlobals kg,
     return;
   }
 
-  const float3 Le_rgb = spectrum_to_rgb(Le);
+  if (state->guiding.path_segment) {
+    const float3 Le_rgb = spectrum_to_rgb(Le);
 
-  openpgl::cpp::SetDirectContribution(state->guiding.path_segment, 
guiding_vec3f(Le_rgb));
-  openpgl::cpp::SetMiWeight(state->guiding.path_segment, 1.0f);
+    openpgl::cpp::SetDirectContribution(state->guiding.path_segment, 
guiding_vec3f(Le_rgb));
+    openpgl::cpp::SetMiWeight(state->guiding.path_segment, 1.0f);
+  }
 #endif
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to