From a92805bf24f52e1764a5f930bbe9e4e8fcc7e24d Mon Sep 17 00:00:00 2001 From: Mikhail Matrosov Date: Tue, 7 Dec 2021 18:48:41 +0100 Subject: Fix T93418: Cycles shadow terminator Geometry Offset artifacts with translucency Differential Revision: https://developer.blender.org/D13468 --- intern/cycles/kernel/light/sample.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'intern') diff --git a/intern/cycles/kernel/light/sample.h b/intern/cycles/kernel/light/sample.h index ff5d43ed8cd..83f6d733d3a 100644 --- a/intern/cycles/kernel/light/sample.h +++ b/intern/cycles/kernel/light/sample.h @@ -200,6 +200,9 @@ ccl_device_inline float3 shadow_ray_offset(KernelGlobals kg, if (offset_cutoff > 0.0f) { float NgL = dot(Ng, L); float offset_amount = 0.0f; + if (NL < 0) { + NL = -NL; + } if (NL < offset_cutoff) { offset_amount = clamp(2.0f - (NgL + NL) / offset_cutoff, 0.0f, 1.0f); } -- cgit v1.2.3