From 1d8ec3247364124cef061697b293f1204261c6a6 Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Thu, 22 Feb 2024 17:10:46 +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: https://projects.blender.org/blender/blender/pulls/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 db727f9442d..74d32aff48a 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit db727f9442d7d88552578e2733e63e3cea87ee55 +Subproject commit 74d32aff48a05236adf61a24d8c1b5b4c7c55097