From 95d11b0d338efc2f72b513c8bf18059185b0de77 Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Fri, 23 Feb 2024 12:40:48 +0100 Subject: [PATCH] Fix Cycles area light using MIS when the spread is zero area light with zero spread was introduced in bf18032977. Such paths can only be sampled with NEE, so MIS should not be used. This fixes the discrepancy when Direct Light Sampling is set to MIS or NEE. Pull Request: #118584 --- intern/cycles/scene/light.cpp | 2 +- tests/data | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 16483f0b798..fe72ef704db 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -1331,7 +1331,7 @@ void LightManager::device_update_lights(Device *device, DeviceScene *dscene, Sce float3 dir = safe_normalize(light->get_dir()); - if (light->use_mis && area != 0.0f) { + if (light->use_mis && area != 0.0f && light->spread > 0.0f) { shader_id |= SHADER_USE_MIS; } diff --git a/tests/data b/tests/data index 582cf6fcb4e..6dd81d3f24e 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit 582cf6fcb4e7456a6d29eb016280943646e6bc68 +Subproject commit 6dd81d3f24ec18cec2ab70d1c4159be3900ccd55