diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-02-24 21:20:03 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-02-24 21:35:36 +0300 |
commit | 6e396e21e666d4c614ded626455011b5a5011b1d (patch) | |
tree | 2c5ed51f7d005e118e873bf18d2369c144b065a5 /intern/cycles | |
parent | 7b37d980b97fd6f2fde7561c5f2a881f46db2c1f (diff) |
Cleanup: remove unused ray offset function
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/bvh/util.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/intern/cycles/kernel/bvh/util.h b/intern/cycles/kernel/bvh/util.h index 39c3ecd78c0..ec23f3a46fe 100644 --- a/intern/cycles/kernel/bvh/util.h +++ b/intern/cycles/kernel/bvh/util.h @@ -18,27 +18,6 @@ CCL_NAMESPACE_BEGIN -/* Ray offset to avoid self intersection. - * - * This function should be used to compute a modified ray start position for - * rays leaving from a surface. This is from "A Fast and Robust Method for Avoiding - * Self-Intersection" see https://research.nvidia.com/publication/2019-03_A-Fast-and - */ -ccl_device_inline float3 ray_offset(float3 P, float3 Ng) -{ - const float int_scale = 256.0f; - int3 of_i = make_int3((int)(int_scale * Ng.x), (int)(int_scale * Ng.y), (int)(int_scale * Ng.z)); - - float3 p_i = make_float3(__int_as_float(__float_as_int(P.x) + ((P.x < 0) ? -of_i.x : of_i.x)), - __int_as_float(__float_as_int(P.y) + ((P.y < 0) ? -of_i.y : of_i.y)), - __int_as_float(__float_as_int(P.z) + ((P.z < 0) ? -of_i.z : of_i.z))); - const float origin = 1.0f / 32.0f; - const float float_scale = 1.0f / 65536.0f; - return make_float3(fabsf(P.x) < origin ? P.x + float_scale * Ng.x : p_i.x, - fabsf(P.y) < origin ? P.y + float_scale * Ng.y : p_i.y, - fabsf(P.z) < origin ? P.z + float_scale * Ng.z : p_i.z); -} - #if defined(__KERNEL_CPU__) ccl_device int intersections_compare(const void *a, const void *b) { |