From 10d830d4110dde2b1caa5dcdc1ceeadc654a380b Mon Sep 17 00:00:00 2001 From: Sergen Eren Date: Mon, 6 Jan 2020 11:12:07 +0300 Subject: [PATCH] check if lights is not empty --- source/render_kernel.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/render_kernel.cu b/source/render_kernel.cu index 645a251..0d5abcf 100644 --- a/source/render_kernel.cu +++ b/source/render_kernel.cu @@ -1796,7 +1796,7 @@ __device__ inline float3 direct_integrator( } if (mi) { L += estimate_sun(kernel_params, rand_state, ray_pos, ray_dir, gpu_vdb, ref_sphere, root, atmosphere) * beta; - L += estimate_point_light(kernel_params, lights, rand_state, ray_pos, ray_dir, gpu_vdb, ref_sphere, root) * beta; + if(lights.num_lights>0) L += estimate_point_light(kernel_params, lights, rand_state, ray_pos, ray_dir, gpu_vdb, ref_sphere, root) * beta; } if (kernel_params.emission_scale > 0 && mi) {