Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdEmbree] add direct camera visibility support for rect lights (hdEmbree-UsdLux-PR12) #3189

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
2 changes: 2 additions & 0 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,7 @@ def _JoinVersion(v):
OpenVDB support: {enableOpenVDB}
OpenImageIO support: {buildOIIO}
OpenColorIO support: {buildOCIO}
Embree support: {buildEmbree}
PRMan support: {buildPrman}
UsdImaging {buildUsdImaging}
usdview: {buildUsdview}
Expand Down Expand Up @@ -2673,6 +2674,7 @@ def FormatBuildArguments(buildArgs):
enableOpenVDB=("On" if context.enableOpenVDB else "Off"),
buildOIIO=("On" if context.buildOIIO else "Off"),
buildOCIO=("On" if context.buildOCIO else "Off"),
buildEmbree=("On" if context.buildEmbree else "Off"),
buildPrman=("On" if context.buildPrman else "Off"),
buildUsdImaging=("On" if context.buildUsdImaging else "Off"),
buildUsdview=("On" if context.buildUsdview else "Off"),
Expand Down
4 changes: 2 additions & 2 deletions pxr/base/work/threadLimits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ WorkGetPhysicalConcurrencyLimit()
#endif
}

// This function always returns an actual thread count >= 1.
// This function always returns either 0 (meaning "no change") or >= 1
static unsigned
Work_NormalizeThreadCount(const int n)
{
// Zero means "no change", and n >= 1 means exactly n threads, so simply
// pass those values through unchanged.
// For negative integers, subtract the absolute value from the total number
// of available cores (denoting all but n cores). If n == number of cores,
// of available cores (denoting all but n cores). If |n| >= number of cores,
// clamp to 1 to set single-threaded mode.
return n >= 0 ? n : std::max<int>(1, n + WorkGetPhysicalConcurrencyLimit());
}
Expand Down
2 changes: 2 additions & 0 deletions pxr/imaging/plugin/hdEmbree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pxr_plugin(hdEmbree
PUBLIC_CLASSES
config
instancer
light
mesh
meshSamplers
renderBuffer
Expand All @@ -45,6 +46,7 @@ pxr_plugin(hdEmbree
renderParam.h

PRIVATE_CLASSES
debugCodes
implicitSurfaceSceneIndexPlugin

RESOURCE_FILES
Expand Down
4 changes: 4 additions & 0 deletions pxr/imaging/plugin/hdEmbree/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

#include "pxr/base/gf/matrix4f.h"
#include "pxr/base/vt/array.h"
#include "pxr/base/vt/types.h"

#include <embree3/rtcore.h>

PXR_NAMESPACE_OPEN_SCOPE

class HdRprim;
class HdEmbree_Light;

/// \class HdEmbreePrototypeContext
///
Expand Down Expand Up @@ -51,6 +53,8 @@ struct HdEmbreeInstanceContext
RTCScene rootScene;
/// The instance id of this instance.
int32_t instanceId;
/// The light (if this is a light)
HdEmbree_Light *light = nullptr;
};


Expand Down
20 changes: 20 additions & 0 deletions pxr/imaging/plugin/hdEmbree/debugCodes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Copyright 2024 Pixar
//
// Licensed under the terms set forth in the LICENSE.txt file available at
// https://openusd.org/license.
//
#include "pxr/pxr.h"
#include "pxr/imaging/plugin/hdEmbree/debugCodes.h"

#include "pxr/base/tf/debug.h"
#include "pxr/base/tf/registryManager.h"

PXR_NAMESPACE_OPEN_SCOPE

TF_REGISTRY_FUNCTION(TfDebug)
{
TF_DEBUG_ENVIRONMENT_SYMBOL(HDEMBREE_LIGHT_CREATE, "Creation of HdEmbree lights");
}

PXR_NAMESPACE_CLOSE_SCOPE
21 changes: 21 additions & 0 deletions pxr/imaging/plugin/hdEmbree/debugCodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright 2024 Pixar
//
// Licensed under the terms set forth in the LICENSE.txt file available at
// https://openusd.org/license.
//
#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H
#define PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H

#include "pxr/pxr.h"
#include "pxr/base/tf/debug.h"

PXR_NAMESPACE_OPEN_SCOPE

TF_DEBUG_CODES(
HDEMBREE_LIGHT_CREATE
);

PXR_NAMESPACE_CLOSE_SCOPE

#endif // PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H
Loading