[Bf-blender-cvs] [31423b25067] soc-2022-many-lights-sampling: Fix assert in some test scenes, make float precision threshold a bit higher

Brecht Van Lommel noreply at git.blender.org
Thu Oct 20 20:29:57 CEST 2022


Commit: 31423b25067e5c7dd0f803e61860b504bc9e8d62
Author: Brecht Van Lommel
Date:   Thu Oct 20 19:05:43 2022 +0200
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB31423b25067e5c7dd0f803e61860b504bc9e8d62

Fix assert in some test scenes, make float precision threshold a bit higher

===================================================================

M	intern/cycles/kernel/light/light_tree.h

===================================================================

diff --git a/intern/cycles/kernel/light/light_tree.h b/intern/cycles/kernel/light/light_tree.h
index 4e634fa2659..bbbfa721dc3 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -69,13 +69,13 @@ ccl_device float light_tree_node_importance(const float3 P,
   float cos_theta_prime;
   if ((cos_theta > cos_theta_u) || (cos_theta_minus_theta_u > cos_theta_o)) {
     /* theta - theta_o - theta_u < 0 */
-    kernel_assert((fast_acosf(cos_theta) - theta_o - fast_acosf(cos_theta_u)) < 1e-4f);
+    kernel_assert((fast_acosf(cos_theta) - theta_o - fast_acosf(cos_theta_u)) < 5e-4f);
     cos_theta_prime = 1.0f;
   }
   else if ((cos_theta > cos_theta_u) || (theta_o + theta_e > M_PI_F) ||
            (cos_theta_minus_theta_u > cos(theta_o + theta_e))) {
     /* theta' = theta - theta_o - theta_u < theta_e */
-    kernel_assert((fast_acosf(cos_theta) - theta_o - fast_acosf(cos_theta_u) - theta_e) < 1e-4f);
+    kernel_assert((fast_acosf(cos_theta) - theta_o - fast_acosf(cos_theta_u) - theta_e) < 5e-4f);
     const float sin_theta_minus_theta_u = safe_sqrtf(1.0f - sqr(cos_theta_minus_theta_u));
     cos_theta_prime = cos_theta_minus_theta_u * cos_theta_o +
                       sin_theta_minus_theta_u * sin_theta_o;



More information about the Bf-blender-cvs mailing list