1
1

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
This commit is contained in:
Olivier Maury
2022-01-07 17:07:08 +01:00
committed by Brecht Van Lommel
parent ae28d90578
commit ee0928d4be

View File

@@ -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]);