Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Matrosov <ktdfly>2021-12-07 20:48:41 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-12-07 21:01:39 +0300
commita92805bf24f52e1764a5f930bbe9e4e8fcc7e24d (patch)
tree6770f8f15eae49f89d394e88b0aa5d5879f3b09e /intern/cycles
parent484714992c879400fbef380dfe77de6b1c875e03 (diff)
Fix T93418: Cycles shadow terminator Geometry Offset artifacts with translucency
Differential Revision: https://developer.blender.org/D13468
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/kernel/light/sample.h3
1 files changed, 3 insertions, 0 deletions
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);
}