diff --git a/kernels/common/scene_curves.h b/kernels/common/scene_curves.h index 2b74b320b5..7350a20ecd 100644 --- a/kernels/common/scene_curves.h +++ b/kernels/common/scene_curves.h @@ -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); } @@ -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); } diff --git a/kernels/common/scene_line_segments.h b/kernels/common/scene_line_segments.h index 065d68c2c4..a672abd8d2 100644 --- a/kernels/common/scene_line_segments.h +++ b/kernels/common/scene_line_segments.h @@ -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); } @@ -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); } @@ -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); } diff --git a/kernels/sycl/rthwif_embree.cpp b/kernels/sycl/rthwif_embree.cpp index db13961143..34e86e2470 100644 --- a/kernels/sycl/rthwif_embree.cpp +++ b/kernels/sycl/rthwif_embree.cpp @@ -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(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,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(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,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(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,context,geomID,primID,filter)); } else @@ -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,context,geomID,primID,filter)); } @@ -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);