Fix: Cycles: NaN Normals from Normal Map

a degenerate triangle could produce a tangent that is antiparallel to
the normal, resulting the mapped normal to be zero, and becomes NaN when
normalized in `object_normal_transform()`. Fixed by falling back to
unperturbed normal in this case.

Fixes an assertion in the attic benchmark scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/140135
This commit is contained in:
Weizhen Huang 2025-06-12 14:12:39 +02:00 committed by Weizhen Huang
parent 1a9a7400e7
commit 735f531cc0

View File

@ -432,7 +432,7 @@ ccl_device_noinline void svm_node_normal_map(KernelGlobals kg,
}
}
if (is_zero(N)) {
if (is_zero(N) || !isfinite_safe(N)) {
N = sd->N;
}