diff options
author | Keuin <[email protected]> | 2022-04-21 20:59:43 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-21 20:59:43 +0800 |
commit | 5f92f7182311b111a1bb9ac2f3bccb9eb5754c2c (patch) | |
tree | b17c0ace4e825c391997545f8ea5654498264204 | |
parent | 40b96a150f25db34f5b213374fae0e74d02f0cc6 (diff) |
Bugfix: vec3::refract assertion fails in complex scenarios. Use looser accuracy requirement.
-rw-r--r-- | vec.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -131,8 +131,8 @@ struct vec3 { // If TIR happens, the ray will be reflected. template<bool Enable_TIR> vec3 refract(const vec3 &r1, double ri_inv) const { - assert(fabs(mod2() - 1.0) < 1e-12); - assert(fabs(r1.mod2() - 1.0) < 1e-12); + assert(fabs(mod2() - 1.0) < 1e-7); + assert(fabs(r1.mod2() - 1.0) < 1e-7); assert(ri_inv > 0); assert(dot(r1) < 0); // normal vector must be on the same side const auto &n = *this; // normal vector |