Skip to content
8 changes: 4 additions & 4 deletions kernels/common/scene_curves.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ namespace embree
}

/*! loads curve vertices for specified time */
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, size_t i, float time) const
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, size_t i, float time, const bool motion_blur = true) const
{
if (hasMotionBlur()) gather(p0,p1,p2,p3,i,time);
if (hasMotionBlur() && motion_blur) gather(p0,p1,p2,p3,i,time);
else gather(p0,p1,p2,p3,i);
}

Expand All @@ -218,9 +218,9 @@ namespace embree
}

/*! loads curve vertices for specified time for mblur and non-mblur case */
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, Vec3fa& n0, Vec3fa& n1, Vec3fa& n2, Vec3fa& n3, size_t i, float time) const
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, Vec3fa& n0, Vec3fa& n1, Vec3fa& n2, Vec3fa& n3, size_t i, float time, bool motion_blur = true) const
{
if (hasMotionBlur()) gather(p0,p1,p2,p3,n0,n1,n2,n3,i,time);
if (hasMotionBlur() && motion_blur) gather(p0,p1,p2,p3,n0,n1,n2,n3,i,time);
else gather(p0,p1,p2,p3,n0,n1,n2,n3,i);
}

Expand Down
12 changes: 6 additions & 6 deletions kernels/common/scene_line_segments.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ namespace embree
}

/*! loads curve vertices for specified time for mblur and non-mblur case */
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, unsigned int vid, float time) const
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, unsigned int vid, float time, const bool motion_blur = true) const
{
if (hasMotionBlur()) gather(p0,p1,vid,time);
if (hasMotionBlur() && motion_blur) gather(p0,p1,vid,time);
else gather(p0,p1,vid);
}

Expand Down Expand Up @@ -250,9 +250,9 @@ namespace embree
}

/*! loads cone curve vertices for specified time for mblur and non-mblur geometry */
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, bool& cL, bool& cR, unsigned int primID, size_t vid, float time) const
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, bool& cL, bool& cR, unsigned int primID, size_t vid, float time, const bool motion_blur = true) const
{
if (hasMotionBlur()) gather(p0,p1,cL,cR,primID,vid,time);
if (hasMotionBlur() && motion_blur) gather(p0,p1,cL,cR,primID,vid,time);
else gather(p0,p1,cL,cR,primID,vid);
}

Expand Down Expand Up @@ -335,9 +335,9 @@ namespace embree
}

/*! loads curve vertices for specified time for mblur and non-mblur geometry */
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, unsigned int primID, size_t vid, float time) const
__forceinline void gather_safe(Vec3ff& p0, Vec3ff& p1, Vec3ff& p2, Vec3ff& p3, unsigned int primID, size_t vid, float time, const bool motion_blur = true) const
{
if (hasMotionBlur()) gather(p0,p1,p2,p3,primID,vid,time);
if (hasMotionBlur() && motion_blur) gather(p0,p1,p2,p3,primID,vid,time);
else gather(p0,p1,p2,p3,primID,vid);
}

Expand Down
10 changes: 5 additions & 5 deletions kernels/sycl/rthwif_embree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,20 +469,20 @@ __forceinline bool intersect_primitive(intel_ray_query_t& query, Ray& ray, Scene
if (gtype == Geometry::GTY_FLAT_LINEAR_CURVE && (feature_mask & RTC_FEATURE_FLAG_FLAT_LINEAR_CURVE))
{
LineSegments* geom = context->scene->get<LineSegments>(geomID);
Vec3ff v0, v1; geom->gather_safe(v0,v1,geom->segment(primID),ray.time());
Vec3ff v0, v1; geom->gather_safe(v0,v1,geom->segment(primID),ray.time(), feature_mask & RTC_FEATURE_FLAG_MOTION_BLUR);
return isa::FlatLinearCurveIntersector1<1>::intersect(true,ray,context,geom,pre,v0,v1,Intersect1Epilog1_HWIF<Ray>(ray,context,geomID,primID,filter));
}
else if (gtype == Geometry::GTY_ROUND_LINEAR_CURVE && (feature_mask & RTC_FEATURE_FLAG_ROUND_LINEAR_CURVE))
{
LineSegments* geom = context->scene->get<LineSegments>(geomID);
Vec3ff v0,v1,v2,v3; geom->gather_safe(v0,v1,v2,v3,primID,geom->segment(primID),ray.time());
Vec3ff v0,v1,v2,v3; geom->gather_safe(v0,v1,v2,v3,primID,geom->segment(primID),ray.time(), feature_mask & RTC_FEATURE_FLAG_MOTION_BLUR);
return isa::RoundLinearCurveIntersector1<1>().intersect(true,ray,context,geom,pre,v0,v1,v2,v3,Intersect1Epilog1_HWIF<Ray>(ray,context,geomID,primID,filter));
}
else if (gtype == Geometry::GTY_CONE_LINEAR_CURVE && (feature_mask & RTC_FEATURE_FLAG_CONE_LINEAR_CURVE))
{
LineSegments* geom = context->scene->get<LineSegments>(geomID);
Vec3ff v0 = zero, v1 = zero; bool cL = false, cR = false;
geom->gather_safe(v0,v1,cL,cR,primID,geom->segment(primID),ray.time());
geom->gather_safe(v0,v1,cL,cR,primID,geom->segment(primID),ray.time(), feature_mask & RTC_FEATURE_FLAG_MOTION_BLUR);
return isa::ConeCurveIntersector1<1>().intersect(true,ray,context,geom,pre,v0,v1,cL,cR,Intersect1Epilog1_HWIF<Ray>(ray,context,geomID,primID,filter));
}
else
Expand Down Expand Up @@ -516,7 +516,7 @@ __forceinline bool intersect_primitive(intel_ray_query_t& query, Ray& ray, Scene
if (basis == Geometry::GTY_BASIS_HERMITE && (feature_mask & RTC_FEATURE_FLAG_NORMAL_ORIENTED_HERMITE_CURVE))
geom->gather_hermite_safe(v0,v1,n0,n1,v2,v3,n2,n3,geom->curve(primID),ray.time());
else
geom->gather_safe(v0,v1,v2,v3,n0,n1,n2,n3,geom->curve(primID),ray.time());
geom->gather_safe(v0,v1,v2,v3,n0,n1,n2,n3,geom->curve(primID),ray.time(), feature_mask & RTC_FEATURE_FLAG_MOTION_BLUR);
isa::convert_to_bezier(gtype, v0,v1,v2,v3, n0,n1,n2,n3);
return Intersector().intersect(pre,ray,context,geom,primID,v0,v1,v2,v3,n0,n1,n2,n3,Intersect1Epilog1_HWIF<Ray>(ray,context,geomID,primID,filter));
}
Expand All @@ -526,7 +526,7 @@ __forceinline bool intersect_primitive(intel_ray_query_t& query, Ray& ray, Scene
if (basis == Geometry::GTY_BASIS_HERMITE && (feature_mask & (RTC_FEATURE_FLAG_ROUND_HERMITE_CURVE | RTC_FEATURE_FLAG_FLAT_HERMITE_CURVE)))
geom->gather_hermite_safe(v0,v1,v2,v3,geom->curve(primID),ray.time());
else
geom->gather_safe(v0,v1,v2,v3,geom->curve(primID),ray.time());
geom->gather_safe(v0,v1,v2,v3,geom->curve(primID),ray.time(), feature_mask & RTC_FEATURE_FLAG_MOTION_BLUR);

isa::convert_to_bezier(gtype, v0,v1,v2,v3);

Expand Down