Update embree to 3.13.5

This commit is contained in:
DeeJayLSP
2022-11-24 11:45:59 -03:00
committed by Rémi Verschelde
parent f16c5b564b
commit 5e4158eb48
110 changed files with 9963 additions and 6494 deletions
+23 -5
View File
@@ -68,15 +68,15 @@ namespace embree
const Vec3vf<M> center = v0.xyz();
const vfloat<M> radius = v0.w;
/* compute ray distance projC0 to hit point with ray oriented plane */
const Vec3vf<M> c0 = center - ray_org;
const vfloat<M> projC0 = dot(c0, ray_dir) * rd2;
valid &= (vfloat<M>(ray.tnear()) <= projC0) & (projC0 <= vfloat<M>(ray.tfar));
if (EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR != 0.0f)
valid &= projC0 > float(EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR) * radius * pre.depth_scale; // ignore self intersections
if (unlikely(none(valid)))
return false;
/* check if hit point lies inside disc */
const Vec3vf<M> perp = c0 - projC0 * ray_dir;
const vfloat<M> l2 = dot(perp, perp);
const vfloat<M> r2 = radius * radius;
@@ -84,6 +84,15 @@ namespace embree
if (unlikely(none(valid)))
return false;
/* We reject hits where the ray origin lies inside the ray
* oriented disc to avoid self intersections. */
#if defined(EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE)
const vfloat<M> m2 = dot(c0, c0);
valid &= (m2 > r2);
if (unlikely(none(valid)))
return false;
#endif
DiscIntersectorHitM<M> hit(zero, zero, projC0, -ray_dir);
return epilog(valid, hit);
}
@@ -152,15 +161,15 @@ namespace embree
const Vec3vf<M> center = v0.xyz();
const vfloat<M> radius = v0.w;
/* compute ray distance projC0 to hit point with ray oriented plane */
const Vec3vf<M> c0 = center - ray_org;
const vfloat<M> projC0 = dot(c0, ray_dir) * rd2;
valid &= (vfloat<M>(ray.tnear()[k]) <= projC0) & (projC0 <= vfloat<M>(ray.tfar[k]));
if (EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR != 0.0f)
valid &= projC0 > float(EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR) * radius * pre.depth_scale[k]; // ignore self intersections
if (unlikely(none(valid)))
return false;
/* check if hit point lies inside disc */
const Vec3vf<M> perp = c0 - projC0 * ray_dir;
const vfloat<M> l2 = dot(perp, perp);
const vfloat<M> r2 = radius * radius;
@@ -168,6 +177,15 @@ namespace embree
if (unlikely(none(valid)))
return false;
/* We reject hits where the ray origin lies inside the ray
* oriented disc to avoid self intersections. */
#if defined(EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE)
const vfloat<M> m2 = dot(c0, c0);
valid &= (m2 > r2);
if (unlikely(none(valid)))
return false;
#endif
DiscIntersectorHitM<M> hit(zero, zero, projC0, -ray_dir);
return epilog(valid, hit);
}