From 735f531cc0036ab94638d0f37b3fbdea0d91c1bf Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Thu, 12 Jun 2025 14:12:39 +0200 Subject: [PATCH] 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 --- intern/cycles/kernel/svm/tex_coord.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/kernel/svm/tex_coord.h b/intern/cycles/kernel/svm/tex_coord.h index ab551853de9..8608744511e 100644 --- a/intern/cycles/kernel/svm/tex_coord.h +++ b/intern/cycles/kernel/svm/tex_coord.h @@ -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; }