Skip to content

Commit

Permalink
Merge branch 'release-1.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
rbinyahib committed Jul 17, 2024
2 parents 7b3695d + a067864 commit 397937a
Show file tree
Hide file tree
Showing 30 changed files with 582 additions and 193 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ jobs:
export CC=clang
export CXX=clang++
scripts/release_ci/macosx_houdini.sh
$SIGN_FILE_MAC -o runtime -e scripts/release_ci/hdospray.entitlements build_release/*zip
scripts/release_ci/macosx_notarization.sh build_release/*.zip
# signing on mac currently broken
#$SIGN_FILE_MAC -o runtime -e scripts/release_ci/hdospray.entitlements build_release/*zip
#scripts/release_ci/macosx_notarization.sh build_release/*.zip
artifact-out: release-osx-clang-houdini
artifact-path: "build_release/*.zip"

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PROJECT(hdOSPRayPlugin)

set(HDOSPRAY_VERSION_MAJOR 1)
set(HDOSPRAY_VERSION_MINOR 0)
set(HDOSPRAY_VERSION_MINOR 1)
set(HDOSPRAY_VERSION_PATCH 0)
set(HDOSPRAY_VERSION ${HDOSPRAY_VERSION_MAJOR}.${HDOSPRAY_VERSION_MINOR}.${HDOSPRAY_VERSION_PATCH})

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ building and what system you are running: - c/c++ compiler (gcc 6.3.1+)
install PySide6 PyOpenGL’

If you are building standalone, you will need: -
[USD 23.02, 22.08, 21.08,
[USD 23.08, 23.02, 22.08, 21.08,
or 20.08](https://graphics.pixar.com/usd/docs/index.html) - Other USD
versions between these discrete releases may work, but are untested. -
For a full list of USD dependencies, see the USD page. -
[OSPRay 3.0.0](http://www.ospray.org/) - We recommend using ospray’s
[OSPRay 3.1.0](http://www.ospray.org/) - We recommend using ospray’s
superbuild to build dependencies such as embree, ospcommon, and openvkl.
OpenImageDenoise can also be enabled through superbuild. - rkcommon is a
library dependency of OSPRay and hdOSPRay, and built as part of OSPRay’s
Expand All @@ -87,7 +87,7 @@ superbuild.
OSPRay for Hydra contains a cmake superbuild script that builds external
dependencies for you and is the recommended way of building OSPRay for
Hydra on Linux/Mac. Alternatively, instructions for manually building
each component is also given. Currently, USD 23.02 is the default.
each component is also given. Currently, USD 23.08 is the default.

mkdir build
cd build
Expand Down Expand Up @@ -295,6 +295,10 @@ renderer.*
- Principled shader (similar to Disney BSDF shader)

# News, Updates, and Announcements
- Jul 16, 2024: Version v1.1.0

- USD 23.08 support
- OSPRay 3.1

- Oct 25, 2023: Version v1.0.0

Expand Down
5 changes: 5 additions & 0 deletions doc/news.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
News, Updates, and Announcements
================================

- Jul 16, 2024: Version v1.1.0

- USD 23.08 support
- OSPRay 3.1

- Oct 25, 2023: Version v1.0.0

- USD 23.02 support
Expand Down
15 changes: 14 additions & 1 deletion hdOSPRay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

set(CMAKE_CXX_STANDARD 17)

get_filename_component(SYCL_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
if (WIN32 AND (SYCL_COMPILER_NAME STREQUAL "icx" OR SYCL_COMPILER_NAME STREQUAL "icpx"))
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /Qoption,link,/DEPENDENTLOADFLAG:0x2000")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /Qoption,link,/DEPENDENTLOADFLAG:0x2000")
elseif (WIN32) #MSVC
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEPENDENTLOADFLAG:0x2000")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEPENDENTLOADFLAG:0x2000")
endif()

# Add a relative target path to the HDOSPRAY_RPATH.
function(_add_target_to_rpath CURRENT_RPATH target)
get_target_property(LIBRARY_FILE ${target} LOCATION)
Expand All @@ -21,7 +30,7 @@ option(USE_HOUDINI_USD "use Houdini USD" OFF)

find_package(ospray 3 REQUIRED
PATHS ${ospray_DIR})
find_package(rkcommon 1.12.0 REQUIRED
find_package(rkcommon 1 REQUIRED
PATHS ${rkcommon_DIR})

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
Expand Down Expand Up @@ -89,6 +98,10 @@ target_compile_definitions(hdOSPRay
$<$<CXX_COMPILER_ID:MSVC>:/MP /wd4244 /wd4305 /wd4996>
)

if (APPLE) # fix boost error with xcode
add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
endif()

install(TARGETS hdOSPRay DESTINATION plugin/usd)

# plugInfo.json
Expand Down
2 changes: 1 addition & 1 deletion hdOSPRay/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TF_DEFINE_ENV_SETTING(HDOSPRAY_SAMPLES_TO_CONVERGENCE, HDOSPRAY_DEFAULT_SPP_TO_C
TF_DEFINE_ENV_SETTING(HDOSPRAY_AMBIENT_OCCLUSION_SAMPLES, HDOSPRAY_DEFAULT_AO_SAMPLES,
"Ambient occlusion samples per camera ray (must be >= 0; a value of 0 disables ambient occlusion)");

TF_DEFINE_ENV_SETTING(HDOSPRAY_LIGHT_SAMPLES, 1,
TF_DEFINE_ENV_SETTING(HDOSPRAY_LIGHT_SAMPLES, -1,
"Light samples at every path intersection. A value of -1 means that all light are sampled.");

TF_DEFINE_ENV_SETTING(HDOSPRAY_CAMERA_LIGHT_INTENSITY, 300,
Expand Down
9 changes: 8 additions & 1 deletion hdOSPRay/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <pxr/base/tf/debug.h>
#include <pxr/base/tf/singleton.h>
#include <pxr/pxr.h>
#include <pxr/base/gf/vec4f.h>

#include <ospray/ospray_cpp.h>
#include <ospray/ospray_cpp/ext/rkcommon.h>
Expand Down Expand Up @@ -138,6 +139,12 @@ class HdOSPRayConfig {
/// Override with *HDOSPRAY_AMBIENT_LIGHT*.
bool ambientLight { false };

/// ShadowCatcher for ospray path tracer
GfVec4f shadowCatcherPlane;

/// Geometry Lights
bool geometryLights { false };

/// OSPRay device
///
/// "cpu" or "gpu" device
Expand Down Expand Up @@ -169,4 +176,4 @@ class HdOSPRayConfig {
HdOSPRayConfig& operator=(const HdOSPRayConfig&) = delete;

friend class TfSingleton<HdOSPRayConfig>;
};
};
12 changes: 8 additions & 4 deletions hdOSPRay/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ PXR_NAMESPACE_USING_DIRECTIVE
namespace {

TF_DEFINE_PRIVATE_TOKENS(_tokens,
((discoveryType1, "OspPrincipled"))((discoveryType2,
"OspCarPaint"))(
(discoveryType3, "OspLuminous")));
((discoveryType1, "OspPrincipled"))
((discoveryType2, "OspCarPaint"))
((discoveryType3, "OspLuminous"))
((discoveryType4, "OspThinGlass"))
((discoveryType5, "OspGlass"))
);

// Maps a nodedef name to its NdrNode name.
using _NameMapping = std::map<std::string, std::string>;
Expand Down Expand Up @@ -87,7 +90,8 @@ HdOSPRayDiscoveryPlugin::DiscoverNodes(const Context& context)
NdrNodeDiscoveryResultVec result;
std::vector<TfToken> tkns
= { TfToken("OspPrincipled"), TfToken("OspCarPaint"),
TfToken("OspLuminous") };
TfToken("OspLuminous"), TfToken("OspThinGlass"),
TfToken("OspGlass") };
for (auto& tkn : tkns) {
result.emplace_back(tkn, // id
NdrVersion(1), // version
Expand Down
55 changes: 36 additions & 19 deletions hdOSPRay/lights/rectLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
#include <pxr/imaging/hd/sceneDelegate.h>

#include <pxr/base/gf/matrix4d.h>
#include <pxr/base/gf/rotation.h>

#include <pxr/usd/sdf/assetPath.h>

#include <iostream>

using namespace rkcommon::math;

// clang-format off
TF_DEFINE_PRIVATE_TOKENS(
HdOSPRayRectLightTokens,
((edge1,"ospray:edge1"))
((edge2,"ospray:edge2"))
((position,"ospray:position"))
);

HdOSPRayRectLight::HdOSPRayRectLight(SdfPath const& id)
: HdOSPRayLight(id)
{
Expand All @@ -34,6 +43,19 @@ HdOSPRayRectLight::_LightSpecificSync(HdSceneDelegate* sceneDelegate,
.Get<float>();
_height = sceneDelegate->GetLightParamValue(id, HdLightTokens->height)
.Get<float>();
auto edge1Param = sceneDelegate->GetLightParamValue(id, HdOSPRayRectLightTokens->edge1);
if (edge1Param.IsHolding<GfVec3f>()) {
_edge1 = edge1Param.Get<GfVec3f>();
}
auto edge2Param = sceneDelegate->GetLightParamValue(id, HdOSPRayRectLightTokens->edge2);
if (edge2Param.IsHolding<GfVec3f>()) {
_edge2 = edge2Param.Get<GfVec3f>();
}
auto positionParam = sceneDelegate->GetLightParamValue(id, HdOSPRayRectLightTokens->position);
if (positionParam.IsHolding<GfVec3f>()) {
_position = positionParam.Get<GfVec3f>();
_positionSet = true;
}
auto val = sceneDelegate->GetLightParamValue(
id, HdLightTokens->textureFile);
if (!val.IsEmpty()) {
Expand All @@ -60,26 +82,14 @@ HdOSPRayRectLight::_PrepareOSPLight()

// OSPRay quad light
// estimation of the parametrization of the OSPray quad light

// the corner points of the quad light
GfVec3f ops_quadUpperLeft(-_width / 2.0f, _height / 2.0f, 0);
GfVec3f osp_quadLowerLeft(-_width / 2.0f, -_height / 2.0f, 0);
GfVec3f osp_quadLowerRight(_width / 2.0f, -_height / 2.0f, 0);

ops_quadUpperLeft = _transform.Transform(ops_quadUpperLeft);
osp_quadLowerLeft = _transform.Transform(osp_quadLowerLeft);
osp_quadLowerRight = _transform.Transform(osp_quadLowerRight);
GfVec3f xAxis(1.f, 0.f, 0.f);
GfVec3f yAxis(0.f, -1.f, 0.f);

// caluculating the OSPRay quad parametrization from the transformed
// corner points
GfVec3f osp_position = GfVec3f(osp_quadLowerLeft[0], osp_quadLowerLeft[1],
osp_quadLowerLeft[2]);
GfVec3f osp_edge1 = GfVec3f(osp_quadLowerRight[0] - osp_position[0],
osp_quadLowerRight[1] - osp_position[1],
osp_quadLowerRight[2] - osp_position[2]);
GfVec3f osp_edge2 = GfVec3f(ops_quadUpperLeft[0] - osp_position[0],
ops_quadUpperLeft[1] - osp_position[1],
ops_quadUpperLeft[2] - osp_position[2]);
GfVec3f osp_edge1 = xAxis * _width;
GfVec3f osp_edge2 = yAxis * _height;
GfVec3f osp_position = GfVec3f(usd_rectLightCenter - xAxis * _width/2.f - yAxis * _height/2.f);

// the quad light emits light in the direction
// defined by the cross product of edge1 and edge2
Expand All @@ -90,8 +100,8 @@ HdOSPRayRectLight::_PrepareOSPLight()
// checking, if we need to flip the direction of the osp quad light
// to match the direction of the USD rect light
if (GfDot(osp_quadDir, usd_rectLightDir) < 0.0f) {
osp_position = osp_position + osp_edge1;
osp_edge1 = osp_edge1 * -1.0f;
osp_position = osp_position + osp_edge2;
osp_edge2 = osp_edge2 * -1.0f;
}

OSPIntensityQuantity intensityQuantity = _emissionParam.intensityQuantity;
Expand All @@ -102,6 +112,13 @@ HdOSPRayRectLight::_PrepareOSPLight()
: OSP_INTENSITY_QUANTITY_RADIANCE;
}

if (_edge1 != GfVec3f(0.f))
osp_edge1 = _edge1;
if (_edge2 != GfVec3f(0.f))
osp_edge2 = _edge2;
if (_positionSet)
osp_position = _position;

_ospLight = opp::Light("quad");
// placement
_ospLight.setParam(
Expand Down
4 changes: 4 additions & 0 deletions hdOSPRay/lights/rectLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class HdOSPRayRectLight final : public HdOSPRayLight {
/// width and height of the USDRectLight
float _width { 1.0f };
float _height { 1.0f };
GfVec3f _edge1;
GfVec3f _edge2;
GfVec3f _position;
bool _positionSet { false };

/// the texture file to model the emission
/// Note: not supported by OSPRay yet
Expand Down
Loading

0 comments on commit 397937a

Please sign in to comment.