Browse Source

bump embree 4 and missing template (#2460)

* add missing template

* bump embree

---------

Co-authored-by: Alec Jacobson <[email protected]>
Alec Jacobson 8 months ago
parent
commit
08be0704c2

+ 1 - 1
cmake/recipes/external/embree.cmake

@@ -8,7 +8,7 @@ include(FetchContent)
 FetchContent_Declare(
     embree
     GIT_REPOSITORY https://github.com/embree/embree.git
-    GIT_TAG        v3.13.3
+    GIT_TAG        v4.4.0
     GIT_SHALLOW    TRUE
 )
 

+ 1 - 1
include/igl/embree/EmbreeDevice.h

@@ -11,7 +11,7 @@
 
 #ifndef IGL_EMBREE_EMBREE_DEVICE_H
 #define IGL_EMBREE_EMBREE_DEVICE_H
-#include <embree3/rtcore.h>
+#include <embree4/rtcore.h>
 #include <iostream>
 
 namespace igl

+ 3 - 9
include/igl/embree/EmbreeIntersector.cpp

@@ -160,9 +160,7 @@ IGL_INLINE bool igl::embree::EmbreeIntersector::intersectRay(
 
   // shot ray
   {
-    RTCIntersectContext context;
-    rtcInitIntersectContext(&context);
-    rtcIntersect1(scene,&context,&ray);
+    rtcIntersect1(scene,&ray);
     ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
     ray.hit.Ng_y = -ray.hit.Ng_y;
     ray.hit.Ng_z = -ray.hit.Ng_z;
@@ -271,9 +269,7 @@ igl::embree::EmbreeIntersector
     ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID;
     num_rays++;
     {
-      RTCIntersectContext context;
-      rtcInitIntersectContext(&context);
-      rtcIntersect1(scene,&context,&ray);
+      rtcIntersect1(scene,&ray);
       ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
       ray.hit.Ng_y = -ray.hit.Ng_y;
       ray.hit.Ng_z = -ray.hit.Ng_z;
@@ -353,9 +349,7 @@ igl::embree::EmbreeIntersector
   createRay(ray,a,ab,0,1.0,mask);
 
   {
-    RTCIntersectContext context;
-    rtcInitIntersectContext(&context);
-    rtcIntersect1(scene,&context,&ray);
+    rtcIntersect1(scene,&ray);
     ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
     ray.hit.Ng_y = -ray.hit.Ng_y;
     ray.hit.Ng_z = -ray.hit.Ng_z;

+ 2 - 2
include/igl/embree/EmbreeIntersector.h

@@ -20,8 +20,8 @@
 #include <Eigen/Geometry>
 #include <Eigen/Core>
 
-#include <embree3/rtcore.h>
-#include <embree3/rtcore_ray.h>
+#include <embree4/rtcore.h>
+#include <embree4/rtcore_ray.h>
 #include <iostream>
 #include <vector>
 

+ 1 - 3
include/igl/embree/EmbreeRenderer.cpp

@@ -186,9 +186,7 @@ IGL_INLINE bool igl::embree::EmbreeRenderer::intersect_ray(
 
   // shot ray
   {
-    RTCIntersectContext context;
-    rtcInitIntersectContext(&context);
-    rtcIntersect1(scene, &context, &ray);
+    rtcIntersect1(scene,&ray);
     ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
     ray.hit.Ng_y = -ray.hit.Ng_y;
     ray.hit.Ng_z = -ray.hit.Ng_z;

+ 2 - 2
include/igl/embree/EmbreeRenderer.h

@@ -19,8 +19,8 @@
 #include <Eigen/Core>
 #include <Eigen/Geometry>
 
-#include <embree3/rtcore.h>
-#include <embree3/rtcore_ray.h>
+#include <embree4/rtcore.h>
+#include <embree4/rtcore_ray.h>
 #include <iostream>
 #include <vector>
 

+ 1 - 0
include/igl/triangulated_grid.cpp

@@ -62,4 +62,5 @@ IGL_INLINE void igl::triangulated_grid(
 // Explicit template instantiation
 // generated by autoexplicit.sh
 template void igl::triangulated_grid<int, int, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int const&, int const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::triangulated_grid<int, int, Eigen::Matrix<int, -1, -1, 0, -1, -1>>(int const&, int const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>>&);
 #endif