diff options
author | Olivier Maury <omaury> | 2022-01-07 19:07:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-01-07 19:20:04 +0300 |
commit | ee0928d4be6e1f502eb7208f821d8e049795dadd (patch) | |
tree | a0db7f1be93f7229207ea081eb72f161a337d015 /intern/cycles | |
parent | ae28d90578be516bf81f3532846c29f9985f1085 (diff) |
Fix wrong shadow terminator geometry offset for instances
Must take into account SD_OBJECT_TRANSFORM_APPLIED to determine if the normal
was already in world space.
Differential Revision: https://developer.blender.org/D13639
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/light/sample.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/kernel/light/sample.h b/intern/cycles/kernel/light/sample.h index b6662c7f6b3..5a4b7c0a302 100644 --- a/intern/cycles/kernel/light/sample.h +++ b/intern/cycles/kernel/light/sample.h @@ -148,7 +148,9 @@ ccl_device_inline float3 shadow_ray_smooth_surface_offset( float3 P = V[0] * u + V[1] * v + V[2] * w; /* Local space */ float3 n = N[0] * u + N[1] * v + N[2] * w; /* We get away without normalization */ - object_normal_transform(kg, sd, &n); /* Normal x scale, world space */ + if (!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { + object_normal_transform(kg, sd, &n); /* Normal x scale, world space */ + } /* Parabolic approximation */ float a = dot(N[2] - N[0], V[0] - V[2]); |