Fix #111277: NaN in Vector Displacement leading to render errors #111294

Merged
Sergey Sharybin merged 2 commits from Alaska/blender:fix-111277 into main 2023-08-21 15:22:12 +02:00
Showing only changes of commit 9b4e01bef1 - Show all commits

View File

@ -165,7 +165,7 @@ ccl_device_noinline int svm_node_vector_displacement(
tangent = normalize(sd->dPdu);
}
float3 bitangent = normalize(cross(normal, tangent));
float3 bitangent = safe_normalize(cross(normal, tangent));
const AttributeDescriptor attr_sign = find_attribute(kg, sd, node.w);
if (attr_sign.offset != ATTR_STD_NOT_FOUND) {
float sign = primitive_surface_attribute_float(kg, sd, attr_sign, NULL, NULL);