diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-21 16:49:00 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-25 14:27:40 +0300 |
commit | 023eb2ea7c16a00272f83d564145e28aeb9ed2b7 (patch) | |
tree | 424c8baf1d563e36e56b49141887b75149f36a6e /intern/cycles/util/transform.cpp | |
parent | d567785658349504dc98c693c8c46c30e9a60c44 (diff) |
Cycles: more closely match some math and intersection operations in Embree
This helps with debugging, and gives a slightly closer match between CPU
and CUDA/HIP/Metal renders when it comes to ray tracing precision.
Diffstat (limited to 'intern/cycles/util/transform.cpp')
-rw-r--r-- | intern/cycles/util/transform.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/intern/cycles/util/transform.cpp b/intern/cycles/util/transform.cpp index 0bf5de57a20..0b87e88871d 100644 --- a/intern/cycles/util/transform.cpp +++ b/intern/cycles/util/transform.cpp @@ -99,15 +99,7 @@ ProjectionTransform projection_inverse(const ProjectionTransform &tfm) memcpy(M, &tfm, sizeof(M)); if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { - /* matrix is degenerate (e.g. 0 scale on some axis), ideally we should - * never be in this situation, but try to invert it anyway with tweak */ - M[0][0] += 1e-8f; - M[1][1] += 1e-8f; - M[2][2] += 1e-8f; - - if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { - return projection_identity(); - } + return projection_identity(); } memcpy(&tfmR, R, sizeof(R)); @@ -115,16 +107,9 @@ ProjectionTransform projection_inverse(const ProjectionTransform &tfm) return tfmR; } -Transform transform_inverse(const Transform &tfm) -{ - ProjectionTransform projection(tfm); - return projection_to_transform(projection_inverse(projection)); -} - Transform transform_transposed_inverse(const Transform &tfm) { - ProjectionTransform projection(tfm); - ProjectionTransform iprojection = projection_inverse(projection); + ProjectionTransform iprojection(transform_inverse(tfm)); return projection_to_transform(projection_transpose(iprojection)); } |