Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xelatihy committed Apr 27, 2023
1 parent f77ffd8 commit dbde9f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
12 changes: 6 additions & 6 deletions exts/embree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

Expand Down
10 changes: 3 additions & 7 deletions libs/yocto/yocto_bvh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "yocto_geometry.h"

#ifdef YOCTO_EMBREE
#include <embree3/rtcore.h>
#include <embree4/rtcore.h>
#endif

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -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};
Expand All @@ -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;
Expand Down

0 comments on commit dbde9f5

Please sign in to comment.