diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake index cd52f6b7f54..7c3ecd7cd8d 100644 --- a/cmake/modules/FindEmbree.cmake +++ b/cmake/modules/FindEmbree.cmake @@ -20,11 +20,11 @@ #============================================================================= if (APPLE) - set (EMBREE_LIB_NAME libembree3.dylib) + set (EMBREE_LIB_NAME libembree4.dylib) elseif (UNIX) - set (EMBREE_LIB_NAME libembree3.so) + set (EMBREE_LIB_NAME libembree4.so) elseif (WIN32) - set (EMBREE_LIB_NAME embree3.lib) + set (EMBREE_LIB_NAME embree4.lib) endif() find_library(EMBREE_LIBRARY @@ -39,7 +39,7 @@ find_library(EMBREE_LIBRARY ) find_path(EMBREE_INCLUDE_DIR - embree3/rtcore.h + embree4/rtcore.h HINTS "${EMBREE_LOCATION}/include" "$ENV{EMBREE_LOCATION}/include" @@ -47,12 +47,12 @@ DOC "Embree headers path" ) -if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" ) - file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") +if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" ) + file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) - file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") + file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) - file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") + file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") string(REGEX MATCHALL "[0-9]+" PATCH ${TMP}) set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h index 4165adb1e6b..af9cc4ef5b0 100644 --- a/pxr/imaging/plugin/hdEmbree/context.h +++ b/pxr/imaging/plugin/hdEmbree/context.h @@ -14,7 +14,7 @@ #include "pxr/base/gf/matrix4f.h" #include "pxr/base/vt/array.h" -#include +#include PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/mesh.cpp b/pxr/imaging/plugin/hdEmbree/mesh.cpp index 195f83a6336..d3cb949952a 100644 --- a/pxr/imaging/plugin/hdEmbree/mesh.cpp +++ b/pxr/imaging/plugin/hdEmbree/mesh.cpp @@ -203,7 +203,7 @@ void HdEmbreeMesh::_EmbreeCullFaces(const RTCFilterFunctionNArguments* args) default: break; } if (cull) { - // This is how you reject a hit in embree3 instead of setting + // This is how you reject a hit in embree3/4 instead of setting // geomId to invalid on the ray args->valid[i] = 0; } diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h index bbb006302f4..ef1ef07a987 100644 --- a/pxr/imaging/plugin/hdEmbree/mesh.h +++ b/pxr/imaging/plugin/hdEmbree/mesh.h @@ -15,8 +15,8 @@ #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" -#include -#include +#include +#include PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h index c32c35fffa3..3712a9e3ab2 100644 --- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h +++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h @@ -12,8 +12,8 @@ #include "pxr/imaging/hd/meshUtil.h" #include "pxr/base/vt/types.h" -#include -#include +#include +#include #include diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h index 9f613dd069c..19bfb2f6d05 100644 --- a/pxr/imaging/plugin/hdEmbree/pch.h +++ b/pxr/imaging/plugin/hdEmbree/pch.h @@ -76,9 +76,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h index 1d8694daa61..72894b90803 100644 --- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h +++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h @@ -14,7 +14,7 @@ #include "pxr/base/tf/staticTokens.h" #include -#include +#include PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h index 206a7458bcb..354fed4faad 100644 --- a/pxr/imaging/plugin/hdEmbree/renderParam.h +++ b/pxr/imaging/plugin/hdEmbree/renderParam.h @@ -11,7 +11,7 @@ #include "pxr/imaging/hd/renderDelegate.h" #include "pxr/imaging/hd/renderThread.h" -#include +#include PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp index 88d5e790937..820238c3736 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp @@ -667,9 +667,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, rayHit.ray.flags = 0; _PopulateRayHit(&rayHit, origin, dir, 0.0f); { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcIntersect1(_scene, &context, &rayHit); + rtcIntersect1(_scene, &rayHit); // // there is something odd about how this is used in Embree. Is it reversed // here and then when it it used in @@ -1005,9 +1003,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, shadow.flags = 0; _PopulateRay(&shadow, position, shadowDir, 0.001f); { - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcOccluded1(_scene,&context,&shadow); + rtcOccluded1(_scene,&shadow); } // Record this AO ray's contribution to the occlusion factor: a diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h index 2da98808481..fc3e062dd86 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.h +++ b/pxr/imaging/plugin/hdEmbree/renderer.h @@ -15,8 +15,8 @@ #include "pxr/base/gf/matrix4d.h" #include "pxr/base/gf/rect2i.h" -#include -#include +#include +#include #include #include diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp index 02c2ca69f82..93705b2d28b 100644 --- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp @@ -23,7 +23,7 @@ #include "pxr/base/tf/errorMark.h" -#include +#include #include PXR_NAMESPACE_USING_DIRECTIVE