diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-06-03 23:48:44 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-06-03 23:48:44 -0700 |
commit | 3206fc10cb2cf01e61232a04f68917b0c244e552 (patch) | |
tree | ee254da5c3a2f5dea65d5ad3ac8ad3ce6ac76b55 /src/modules/ray/ray_object_sphere.h | |
parent | 902e535fce76b7790a4c010651b2233ed3945781 (diff) |
ray: convert from recursive to iterative tracing
Small speedup, I personally find the code cleaner this way too.
Everything in the hot path should now be inlined, no function calls.
Diffstat (limited to 'src/modules/ray/ray_object_sphere.h')
-rw-r--r-- | src/modules/ray/ray_object_sphere.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/ray/ray_object_sphere.h b/src/modules/ray/ray_object_sphere.h index 1eb37e8..c07f345 100644 --- a/src/modules/ray/ray_object_sphere.h +++ b/src/modules/ray/ray_object_sphere.h @@ -43,7 +43,7 @@ static inline int ray_object_sphere_intersects_ray(ray_object_sphere_t *sphere, float dot_vv = sphere->_prepared.primary_dot_vv; float b, disc; - if (depth != 1) { + if (depth) { v = ray_3f_sub(&ray->origin, &sphere->center); dot_vv = ray_3f_dot(&v, &v); } |