Fix #139753: Discontinuity in mesh tangent without UV map

when there is no uv, we call the function `map_to_sphere()` to create
temporary uv for computing the tangent. It could happen that a triangle
has vertices with the u coordinates going across the line where u wraps
from 1 to 0. In this case, just computing the difference of the u
coordinates results in the wrong triangle area.

To fix this problem, we compute distance in toroidal (wrap around)
space.

This is safe for coordinates generated by `map_to_sphere()` function,
because it is not supposed to map the positions of a triangle to u
coordinates that span larger than 0.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/139880
This commit is contained in:
Weizhen Huang
2025-06-09 13:52:00 +02:00
committed by Weizhen Huang
parent 1dfe8047d3
commit ee578cc738
7 changed files with 41 additions and 11 deletions

View File

@@ -43,8 +43,6 @@ BLOCKLIST = [
]
BLOCKLIST_METAL = [
# Blocked due to difference in tangent space calculation (to be fixed).
"tangent_no_uv.blend",
# Blocked due to difference in volume lightprobe bakes (to be fixed).
"clamp_.*.blend",
"shadow_all_max_bounces.blend",