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 lighting support for IES files (hdEmbree-UsdLux-PR17) #3194

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
58058a8
[hdEmbree][build_usd] add to build_usd.py status message
pmolodo Aug 15, 2024
7341bf0
[work] fix docs for Work_NormalizeThreadCount
pmolodo Oct 22, 2024
89e974f
[hdEmbree] ensure we respect PXR_WORK_THREAD_LIMIT
pmolodo Jul 10, 2024
76c2135
[hdEmbree] Initial UsdLux reference implementation
anderslanglands Aug 31, 2023
6e232d7
[hdEmbree] add HDEMBREE_LIGHT_CREATE debug code
pmolodo Jul 29, 2024
035a0d1
[hdEmbree] add support for lighting double-sided meshes
pmolodo Jul 22, 2024
988665c
[hdEmbree] add support for inputs:diffuse
pmolodo Jul 31, 2024
ebb46db
[hdEmbree] add light texture support
pmolodo Jul 30, 2024
4cb4d2f
[hdEmbree] add dome light suppport
pmolodo Jul 30, 2024
bfd9507
[hdEmbree] add direct camera visibility support for rect lights
pmolodo Jul 30, 2024
64da5d0
[hdEmbree] add pxrPbrt/pbrUtils.h
pmolodo Jul 30, 2024
d2840eb
[hdEmbree] add distant light support
pmolodo Jul 30, 2024
1a044a1
[hdEmbree] ies.h / ies.cpp: add unaltered
pmolodo Apr 24, 2024
8a6e0ce
[hdEmbree] ies.h / ies.cpp: patch, and add pxr-IES.patch and README.md
pmolodo May 22, 2024
b1765a8
[hdEmbree] build ies.cpp
pmolodo Jun 5, 2024
e620064
[hdEmbree] ies: disable cycles' candela-to-watt conversion factor by
pmolodo Jun 5, 2024
85ebf2c
[hdEmbree] ies: add PxrIESFile subclass, which calculates power via i…
pmolodo Jun 6, 2024
fd70f4c
[hdEmbree] PxrIESFile: add eval() and valid() methods
anderslanglands May 21, 2024
cf4f1d3
[hdEmbree] add lighting support for IES files
pmolodo Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,23 @@ Redistributions in binary form must reproduce the above copyright notice, this l

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

============================================================
pbrt (sampling functions in hdEmbree/pxrPbrt/pbrUtils.h)
============================================================

Copyright(c) 1998-2020 Matt Pharr, Wenzel Jakob, and Greg Humphreys.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

============================================================
Draco
Expand Down
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
11 changes: 11 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,8 +46,18 @@ pxr_plugin(hdEmbree
renderParam.h

PRIVATE_CLASSES
debugCodes
implicitSurfaceSceneIndexPlugin

PRIVATE_HEADERS
pxrIES/ies.h
pxrIES/pxrIES.h
pxrPbrt/pbrtUtils.h

CPPFILES
pxrIES/ies.cpp
pxrIES/pxrIES.cpp

RESOURCE_FILES
plugInfo.json

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