From dbde9f58678e8e89f49b72cd0262ad07de8a39f6 Mon Sep 17 00:00:00 2001 From: Fabio Pellacini Date: Fri, 28 Apr 2023 00:39:41 +0200 Subject: [PATCH] updated --- exts/embree/CMakeLists.txt | 12 ++++++------ libs/yocto/yocto_bvh.cpp | 10 +++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/exts/embree/CMakeLists.txt b/exts/embree/CMakeLists.txt index b778871c4..09d88de33 100644 --- a/exts/embree/CMakeLists.txt +++ b/exts/embree/CMakeLists.txt @@ -5,13 +5,13 @@ if(APPLE) target_include_directories(embree INTERFACE "/usr/local/include") set_target_properties(embree PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "/usr/local/lib/libembree3.dylib" + IMPORTED_LOCATION "/usr/local/lib/libembree4.dylib" INTERFACE_INCLUDE_DIRECTORIES "/usr/local/include") else() target_include_directories(embree INTERFACE "/opt/homebrew/include") set_target_properties(embree PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "/opt/homebrew/lib/libembree3.dylib" + IMPORTED_LOCATION "/opt/homebrew/lib/libembree4.dylib" INTERFACE_INCLUDE_DIRECTORIES "/opt/homebrew/include") endif() endif(APPLE) @@ -20,16 +20,16 @@ if(MSVC) target_include_directories(embree INTERFACE "/Program\ Files/Intel/Embree3/include/") set_target_properties(embree PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "/Program\ Files/Intel/Embree3/bin/embree3.dll" - IMPORTED_IMPLIB "/Program\ Files/Intel/Embree3/lib/embree3.lib" - INTERFACE_INCLUDE_DIRECTORIES "/Program\ Files/Intel/Embree3/include/") + IMPORTED_LOCATION "/Program\ Files/Intel/Embree4/bin/embree4.dll" + IMPORTED_IMPLIB "/Program\ Files/Intel/Embree4/lib/embree4.lib" + INTERFACE_INCLUDE_DIRECTORIES "/Program\ Files/Intel/Embree4/include/") endif(MSVC) if(UNIX AND NOT APPLE) target_include_directories(embree INTERFACE /usr/local/include) set_target_properties(embree PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "/usr/local/lib/libembree3.so" + IMPORTED_LOCATION "/usr/local/lib/libembree4.so" INTERFACE_INCLUDE_DIRECTORIES "/usr/local/include") endif() diff --git a/libs/yocto/yocto_bvh.cpp b/libs/yocto/yocto_bvh.cpp index f32005582..2ee12bb53 100644 --- a/libs/yocto/yocto_bvh.cpp +++ b/libs/yocto/yocto_bvh.cpp @@ -41,7 +41,7 @@ #include "yocto_geometry.h" #ifdef YOCTO_EMBREE -#include +#include #endif // ----------------------------------------------------------------------------- @@ -487,9 +487,7 @@ intersection3f intersect_shape_ebvh(const shape_ebvh& sbvh, embree_ray.ray.id = 0; embree_ray.hit.geomID = RTC_INVALID_GEOMETRY_ID; embree_ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; - auto embree_ctx = RTCIntersectContext{}; - rtcInitIntersectContext(&embree_ctx); - rtcIntersect1((RTCScene)sbvh.ebvh.get(), &embree_ctx, &embree_ray); + rtcIntersect1((RTCScene)sbvh.ebvh.get(), &embree_ray); if (embree_ray.hit.geomID == RTC_INVALID_GEOMETRY_ID) return {}; auto element = (int)embree_ray.hit.primID; auto uv = vec2f{embree_ray.hit.u, embree_ray.hit.v}; @@ -513,9 +511,7 @@ intersection3f intersect_scene_ebvh(const scene_ebvh& sbvh, embree_ray.ray.id = 0; embree_ray.hit.geomID = RTC_INVALID_GEOMETRY_ID; embree_ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; - auto embree_ctx = RTCIntersectContext{}; - rtcInitIntersectContext(&embree_ctx); - rtcIntersect1((RTCScene)sbvh.ebvh.get(), &embree_ctx, &embree_ray); + rtcIntersect1((RTCScene)sbvh.ebvh.get(), &embree_ray); if (embree_ray.hit.geomID == RTC_INVALID_GEOMETRY_ID) return {}; auto instance = (int)embree_ray.hit.instID[0]; auto element = (int)embree_ray.hit.primID;