star-vx

Structuring voxels for ray-tracing
git clone git://git.meso-star.fr/star-vx.git
Log | Files | Refs | README | LICENSE

commit 40830282abcb264403f2725f64250b479a53fc03
parent bd80b3731ca4a491cf230105912c7935a0173fef
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sat, 15 Sep 2018 14:57:02 +0200

Fix issues in the ray-tracing of the binary tree

Diffstat:
Msrc/svx_bintree_trace_ray.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/svx_bintree_trace_ray.c b/src/svx_bintree_trace_ray.c @@ -116,7 +116,7 @@ bintree_trace_ray /* Transform the direction in the normalized bintree space */ dir = (float)(ray_dir[iaxis] * rcp_btreesz); /* Define if the 1D ray direction is roughly null */ - null_dir = eq_epsf(dir, 0, 1.e-6f); + null_dir = eq_eps(ray_dir[iaxis], 0, 1.e-6); /* The ray starts outside the binary tree and point outward the bin tree: it * cannot intersect the binary tree */ @@ -175,7 +175,7 @@ bintree_trace_ray if(is_leaf || challenge) { struct svx_hit hit_tmp; - const float upp = low + scale_exp2; + const float upp = MMIN(low + scale_exp2, pos_max) ; const double t_min = null_dir ? ray_range[0] : (pos_min - org) * ts; const double t_max = null_dir ? ray_range[1] : (upp - org) * ts; const struct buffer_index iattr = buffer_get_child_attr_index