Skip to content

Commit

Permalink
Merge pull request #425 from GPUOpen-LibrariesAndSDKs/develop
Browse files Browse the repository at this point in the history
Merge version 2.0.13
  • Loading branch information
bsavery authored Dec 7, 2020
2 parents b19ddf6 + f9d62dd commit 4d66c92
Show file tree
Hide file tree
Showing 52 changed files with 1,517 additions and 513 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## Version 2.0.13
- Improved interactivity with Interactive Renders.
- Some issues with texture compression present in version 3.0.1 are fixed.
- Issues with normal maps (related to texture compression) are also fixed.
- Fixed issues with .rpr file export:
- Fixed the AOV names in config.json file.
- Fixed the contour rendering option in config.json file
- Export of .rpr file is made faster and textures are reused between animation frames.
- Users no longer need to manually restart the render when switching render mode in Houdini.
- Time-to-first-pixel is made faster when not using denoisers.
- Added an ID parameter to Render Geometry Settings Node in Houdini for setting an explicit Object ID.
- Add a Houdini Node RPR Material Properties for explicitly setting the Material ID to be used in the corresponding AOV.
- Single and two-channel textures are handled correctly now.
- Fixed USDPreviewSurface Normal Maps.


## Version 2.0
### New Features:
- The new plug-in version incorporates version 2.0 of our Radeon™ ProRender system and brings about the significant changes and enhancements:
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ add_subdirectory(pxr/imaging)
install(FILES README.md DESTINATION .)
install(FILES INSTALL.md DESTINATION .)
install(FILES LICENSE.md DESTINATION .)

install(
CODE
"FILE(WRITE \"${CMAKE_INSTALL_PREFIX}/version\"
\"core:${RPR_VERSION_STRING}
plugin:${HD_RPR_MAJOR_VERSION}.${HD_RPR_MINOR_VERSION}.${HD_RPR_PATCH_VERSION}
\")")
2 changes: 2 additions & 0 deletions cmake/defaults/ProjectDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ if (PXR_BUILD_TESTS)
enable_testing()
endif()

include(parseVersion)

if(NOT DEFINED RPR_SDK_PLATFORM)
include(PlatformIntrospection)
DETERMINE_PLATFORM(RPR_SDK_PLATFORM)
Expand Down
2 changes: 1 addition & 1 deletion cmake/defaults/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
# Versioning information
set(HD_RPR_MAJOR_VERSION "2")
set(HD_RPR_MINOR_VERSION "0")
set(HD_RPR_PATCH_VERSION "1")
set(HD_RPR_PATCH_VERSION "13")
21 changes: 21 additions & 0 deletions cmake/macros/parseVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
macro(parseVersion version_file prefix)
if(NOT EXISTS ${version_file})
message(FATAL_ERROR "Invalid ${prefix} SDK: missing ${version_file} file")
endif()

file(STRINGS "${version_file}" _major_version_str
REGEX "^#define[\t ]+${prefix}_VERSION_MAJOR[\t ]+.*")
file(STRINGS "${version_file}" _minor_version_str
REGEX "^#define[\t ]+${prefix}_VERSION_MINOR[\t ]+.*")
file(STRINGS "${version_file}" _revision_version_str
REGEX "^#define[\t ]+${prefix}_VERSION_REVISION[\t ]+.*")

string(REGEX REPLACE "^.*MAJOR[\t ]+([0-9]*).*$" "\\1"
${prefix}_MAJOR_VERSION "${_major_version_str}")
string(REGEX REPLACE "^.*MINOR[\t ]+([0-9]*).*$" "\\1"
${prefix}_MINOR_VERSION "${_minor_version_str}")
string(REGEX REPLACE "^.*REVISION[\t ]+([0-9]*).*$" "\\1"
${prefix}_REVISION_VERSION "${_revision_version_str}")

set(${prefix}_VERSION_STRING "${${prefix}_MAJOR_VERSION}.${${prefix}_MINOR_VERSION}.${${prefix}_REVISION_VERSION}")
endmacro()
23 changes: 2 additions & 21 deletions cmake/modules/FindRif.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,13 @@ if(NOT DEFINED RIF_MODELS_DIR)
set(RIF_MODELS_DIR "${RIF_LOCATION}/models")
endif()

set(RIF_VERSION_FILE "${RIF_LOCATION_INCLUDE}/RadeonImageFilters_version.h")
if(NOT EXISTS ${RIF_VERSION_FILE})
message(FATAL_ERROR "Invalid RIF SDK: missing ${RIF_VERSION_FILE} file")
endif()

file(STRINGS "${RIF_VERSION_FILE}" _rif_major_version_str
REGEX "^#define[\t ]+RIF_VERSION_MAJOR[\t ]+.*")
file(STRINGS "${RIF_VERSION_FILE}" _rif_minor_version_str
REGEX "^#define[\t ]+RIF_VERSION_MINOR[\t ]+.*")
file(STRINGS "${RIF_VERSION_FILE}" _rif_revision_version_str
REGEX "^#define[\t ]+RIF_VERSION_REVISION[\t ]+.*")

string(REGEX REPLACE "^.*MAJOR[\t ]+([0-9]*).*$" "\\1"
RIF_MAJOR_VERSION "${_rif_major_version_str}")
string(REGEX REPLACE "^.*MINOR[\t ]+([0-9]*).*$" "\\1"
RIF_MINOR_VERSION "${_rif_minor_version_str}")
string(REGEX REPLACE "^.*REVISION[\t ]+([0-9]*).*$" "\\1"
RIF_REVISION_VERSION "${_rif_revision_version_str}")

set(RIF_VERSION_STRING "${RIF_MAJOR_VERSION}.${RIF_MINOR_VERSION}.${RIF_REVISION_VERSION}")
parseVersion("${RIF_LOCATION_INCLUDE}/RadeonImageFilters_version.h" RIF)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Rif
REQUIRED_VARS
RIF_VERSION_STRING
RIF_LOCATION_INCLUDE
RIF_VERSION_STRING
RIF_LIBRARY
)
3 changes: 3 additions & 0 deletions cmake/modules/FindRpr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ if(NOT RPR_PLUGINS)
message(FATAL_ERROR "At least one RPR plugin required")
endif()

parseVersion("${RPR_LOCATION_INCLUDE}/RadeonProRender.h" RPR)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Rpr
REQUIRED_VARS
RPR_LOCATION_INCLUDE
RPR_VERSION_STRING
RPR_LOADSTORE_LIBRARY
RPR_LIBRARY
)
Expand Down
2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ add_library(cpprpr STATIC
${RPR_CPP_WRAPPER_LOCATION}/RadeonProRenderCpp.cpp
${RPR_CPP_WRAPPER_LOCATION}/tinyxml2.cpp)
set_target_properties(cpprpr PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(cpprpr PUBLIC ${RPR_CPP_WRAPPER_LOCATION} ${RPRMTLXLOADER_LOCATION})
target_include_directories(cpprpr PUBLIC ${RPRMTLXLOADER_LOCATION} ${RPR_CPP_WRAPPER_LOCATION})
target_link_libraries(cpprpr PUBLIC rpr MaterialXCore MaterialXFormat)
target_compile_definitions(cpprpr PUBLIC
RPR_CPPWRAPER_DISABLE_MUTEXLOCK
Expand Down
2 changes: 1 addition & 1 deletion deps/RPR
Submodule RPR updated 41 files
+ RadeonProRender/binCentOS7/Hybrid.so
+ RadeonProRender/binCentOS7/RprsRender64
+ RadeonProRender/binCentOS7/libNorthstar64.so
+ RadeonProRender/binCentOS7/libRadeonProRender64.so
+ RadeonProRender/binCentOS7/libRprLoadStore64.so
+ RadeonProRender/binCentOS7/libTahoe64.so
+ RadeonProRender/binMacOS/RprsRender64
+ RadeonProRender/binMacOS/libNorthstar64.dylib
+ RadeonProRender/binMacOS/libProRenderGLTF.dylib
+ RadeonProRender/binMacOS/libRadeonProRender64.dylib
+ RadeonProRender/binMacOS/libRprLoadStore64.dylib
+ RadeonProRender/binMacOS/libTahoe64.dylib
+ RadeonProRender/binUbuntu18/Hybrid.so
+ RadeonProRender/binUbuntu18/RprsRender64
+ RadeonProRender/binUbuntu18/libNorthstar64.so
+ RadeonProRender/binUbuntu18/libRadeonProRender64.so
+ RadeonProRender/binUbuntu18/libRprLoadStore64.so
+ RadeonProRender/binUbuntu18/libTahoe64.so
+ RadeonProRender/binWin64/Hybrid.dll
+ RadeonProRender/binWin64/Northstar64.dll
+ RadeonProRender/binWin64/ProRenderGLTF.dll
+ RadeonProRender/binWin64/RadeonProRender64.dll
+ RadeonProRender/binWin64/RprLoadStore64.dll
+ RadeonProRender/binWin64/RprsRender64.exe
+ RadeonProRender/binWin64/Tahoe64.dll
+8 −0 RadeonProRender/inc/ProRenderGLTF.h
+26 −3 RadeonProRender/inc/RadeonProRender.cs
+22 −3 RadeonProRender/inc/RadeonProRender.h
+56 −1 RadeonProRender/inc/RadeonProRender_Baikal.h
+33 −13 RadeonProRender/inc/RadeonProRender_VK.h
+22 −3 RadeonProRender/inc/RadeonProRender_v2.h
+22 −0 RadeonProRender/inc/RprLoadStore.cs
+18 −0 RadeonProRender/inc/RprLoadStore.h
+ RadeonProRender/libWin64/ProRenderGLTF.lib
+ RadeonProRender/libWin64/RadeonProRender64.exp
+ RadeonProRender/libWin64/RadeonProRender64.lib
+ RadeonProRender/libWin64/RprLoadStore64.exp
+ RadeonProRender/libWin64/RprLoadStore64.lib
+239 −244 RadeonProRender/rprTools/rprMtlxLoader.cpp
+1 −1 RadeonProRender/rprTools/rprMtlxLoader.h
+30 −0 release_notes.txt
11 changes: 7 additions & 4 deletions deps/rprMtlxLoader/rprMtlxLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ struct RprMappedNode : public RprNode {
struct RprImageNode : public RprMappedNode {
// TODO: support frame ranges

std::string type;
std::string file;
std::string layer;
mx::ValuePtr defaultValue;
Expand All @@ -379,7 +380,7 @@ struct RprImageNode : public RprMappedNode {
// TODO: can we support this in RPR?
//std::string filtertype;

RprImageNode(LoaderContext* context);
RprImageNode(std::string const& type, LoaderContext* context);
~RprImageNode() override = default;

rpr_status SetInput(mx::Element* inputElement, std::string const& value, std::string const& valueType, LoaderContext* context) override;
Expand Down Expand Up @@ -824,7 +825,7 @@ Node::Ptr Node::Create(mx::Node* mtlxNode, LoaderContext* context) {
};
rprNodeMapping = &s_sqrtMapping;
} else if (mtlxNode->getCategory() == "image") {
return std::make_unique<RprImageNode>(context);
return std::make_unique<RprImageNode>(mtlxNode->getType(), context);
} else if (mtlxNode->getCategory() == "swizzle") {
// TODO: implement healthy man swizzle

Expand Down Expand Up @@ -1371,7 +1372,7 @@ rpr_status RprMappedNode::SetInput(mx::Element* inputElement, std::string const&
return RprNode::SetInput(inputIt->second, valueString, valueType, context);
}

RprImageNode::RprImageNode(LoaderContext* context)
RprImageNode::RprImageNode(std::string const& type, LoaderContext* context)
: RprMappedNode(
[context]() {
rpr_material_node node = nullptr;
Expand All @@ -1386,7 +1387,8 @@ RprImageNode::RprImageNode(LoaderContext* context)
};
return &s_imageMapping;
}()
) {
)
, type(type) {

}

Expand Down Expand Up @@ -1995,6 +1997,7 @@ RPRMtlxLoader::Result RPRMtlxLoader::Load(
outImageNodes.emplace_back();
auto& outImageNode = outImageNodes.back();

std::swap(outImageNode.type, imageNode->type);
std::swap(outImageNode.file, imageNode->file);
std::swap(outImageNode.layer, imageNode->layer);
std::swap(outImageNode.defaultValue, imageNode->defaultValue);
Expand Down
3 changes: 3 additions & 0 deletions deps/rprMtlxLoader/rprMtlxLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class RPRMtlxLoader {
static const size_t kInvalidRootNodeIndex = size_t(-1);

struct ImageNode {
/// MaterialX type
std::string type;

/// The URI of an image file.
/// It's responsibility of the loader user to setup rpr_image and bind it to rprNode
std::string file;
Expand Down
6 changes: 2 additions & 4 deletions pxr/imaging/plugin/hdRpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif(HoudiniUSD_FOUND)
set(GEN_SCRIPT_PYTHON ${PYTHON_EXECUTABLE})
set(GENERATION_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python)
set(GEN_SCRIPT ${GENERATION_SCRIPTS_DIR}/generateFiles.py)
set(GEN_SCRIPT_ARGS \"${GENERATION_SCRIPTS_DIR}\" \"${CMAKE_CURRENT_BINARY_DIR}\")
set(GEN_SCRIPT_ARGS \"${CMAKE_CURRENT_BINARY_DIR}\")
set(GENERATED_FILES
${CMAKE_CURRENT_BINARY_DIR}/config.h
${CMAKE_CURRENT_BINARY_DIR}/config.cpp)
Expand All @@ -39,7 +39,7 @@ set(GENERATION_DEPENDENT_FILES ${GEN_SCRIPT}
${GENERATION_SCRIPTS_DIR}/generateRenderSettingFiles.py
${GENERATION_SCRIPTS_DIR}/generateGeometrySettingFiles.py)
if(HoudiniUSD_FOUND)
set(GEN_SCRIPT_ARGS --houdini_root \"${HOUDINI_ROOT}\" ${GEN_SCRIPT_ARGS})
set(GEN_SCRIPT_ARGS --for_houdini ${GEN_SCRIPT_ARGS})
set(GENERATED_FILES ${GENERATED_FILES}
${CMAKE_CURRENT_BINARY_DIR}/HdRprPlugin_Light.ds
${CMAKE_CURRENT_BINARY_DIR}/HdRprPlugin_Global.ds
Expand All @@ -62,8 +62,6 @@ if(HoudiniUSD_FOUND)
}\")")
endif()

set(GEN_SCRIPT_ARGS --python_exe "\"${GEN_SCRIPT_PYTHON}\"" ${GEN_SCRIPT_ARGS})

add_custom_command(
COMMAND ${GEN_SCRIPT_PYTHON} ${GEN_SCRIPT} ${GEN_SCRIPT_ARGS}
DEPENDS ${GENERATION_DEPENDENT_FILES}
Expand Down
18 changes: 16 additions & 2 deletions pxr/imaging/plugin/hdRpr/aovDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TF_INSTANTIATE_SINGLETON(HdRprAovRegistry);
TF_DEFINE_PUBLIC_TOKENS(HdRprAovTokens, HDRPR_AOV_TOKENS);

HdRprAovRegistry::HdRprAovRegistry() {
const auto rprAovMax = RPR_AOV_LPE_8 + 1;
const auto rprAovMax = RPR_AOV_CRYPTOMATTE_OBJ2 + 1;
const GfVec4f idClearValue(255.0f, 255.0f, 255.0f, 0.0f);

m_aovDescriptors.resize(rprAovMax);
Expand Down Expand Up @@ -61,7 +61,13 @@ HdRprAovRegistry::HdRprAovRegistry() {
RPR_AOV_LPE_5,
RPR_AOV_LPE_6,
RPR_AOV_LPE_7,
RPR_AOV_LPE_8
RPR_AOV_LPE_8,
RPR_AOV_CRYPTOMATTE_MAT0,
RPR_AOV_CRYPTOMATTE_MAT1,
RPR_AOV_CRYPTOMATTE_MAT2,
RPR_AOV_CRYPTOMATTE_OBJ0,
RPR_AOV_CRYPTOMATTE_OBJ1,
RPR_AOV_CRYPTOMATTE_OBJ2,
}) {
m_aovDescriptors[rprAovId] = HdRprAovDescriptor(rprAovId);
}
Expand All @@ -78,6 +84,7 @@ HdRprAovRegistry::HdRprAovRegistry() {
m_aovDescriptors[RPR_AOV_BACKGROUND] = HdRprAovDescriptor(RPR_AOV_BACKGROUND, false);
m_aovDescriptors[RPR_AOV_VELOCITY] = HdRprAovDescriptor(RPR_AOV_VELOCITY, false);
m_aovDescriptors[RPR_AOV_VIEW_SHADING_NORMAL] = HdRprAovDescriptor(RPR_AOV_VIEW_SHADING_NORMAL, false);
m_aovDescriptors[RPR_AOV_CAMERA_NORMAL] = HdRprAovDescriptor(RPR_AOV_CAMERA_NORMAL, false);

m_computedAovDescriptors.resize(kComputedAovsCount);
m_computedAovDescriptors[kNdcDepth] = HdRprAovDescriptor(kNdcDepth, false, HdFormatFloat32, GfVec4f(std::numeric_limits<float>::infinity()), true);
Expand Down Expand Up @@ -135,6 +142,13 @@ HdRprAovRegistry::HdRprAovRegistry() {
addAovNameLookup(HdRprAovTokens->lpe6, m_aovDescriptors[RPR_AOV_LPE_6]);
addAovNameLookup(HdRprAovTokens->lpe7, m_aovDescriptors[RPR_AOV_LPE_7]);
addAovNameLookup(HdRprAovTokens->lpe8, m_aovDescriptors[RPR_AOV_LPE_8]);
addAovNameLookup(HdRprAovTokens->cameraNormal, m_aovDescriptors[RPR_AOV_CAMERA_NORMAL]);
addAovNameLookup(HdRprAovTokens->cryptomatteMat0, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_MAT0]);
addAovNameLookup(HdRprAovTokens->cryptomatteMat1, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_MAT1]);
addAovNameLookup(HdRprAovTokens->cryptomatteMat2, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_MAT2]);
addAovNameLookup(HdRprAovTokens->cryptomatteObj0, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_OBJ0]);
addAovNameLookup(HdRprAovTokens->cryptomatteObj1, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_OBJ1]);
addAovNameLookup(HdRprAovTokens->cryptomatteObj2, m_aovDescriptors[RPR_AOV_CRYPTOMATTE_OBJ2]);
}

HdRprAovDescriptor const& HdRprAovRegistry::GetAovDesc(TfToken const& name) {
Expand Down
7 changes: 7 additions & 0 deletions pxr/imaging/plugin/hdRpr/aovDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ PXR_NAMESPACE_OPEN_SCOPE
(lpe6) \
(lpe7) \
(lpe8) \
(cameraNormal) \
(cryptomatteMat0) \
(cryptomatteMat1) \
(cryptomatteMat2) \
(cryptomatteObj0) \
(cryptomatteObj1) \
(cryptomatteObj2) \

TF_DECLARE_PUBLIC_TOKENS(HdRprAovTokens, HDRPR_AOV_TOKENS);

Expand Down
33 changes: 30 additions & 3 deletions pxr/imaging/plugin/hdRpr/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,
}
}

bool isIgnoreContourDirty = false;
bool isVisibilityMaskDirty = false;
bool isIdDirty = false;
if (*dirtyBits & HdChangeTracker::DirtyPrimvar) {
HdRprGeometrySettings geomSettings = {};
geomSettings.visibilityMask = kVisibleAll;
Expand All @@ -376,6 +378,16 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,
m_visibilityMask = geomSettings.visibilityMask;
isVisibilityMaskDirty = true;
}

if (m_id != geomSettings.id) {
m_id = geomSettings.id;
isIdDirty = true;
}

if (m_ignoreContour != geomSettings.ignoreContour) {
m_ignoreContour = geomSettings.ignoreContour;
isIgnoreContourDirty = true;
}
}

m_smoothNormals = m_displayStyle.flatShadingEnabled;
Expand Down Expand Up @@ -420,7 +432,6 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,

if (m_geomSubsets.empty()) {
if (auto rprMesh = rprApi->CreateMesh(m_points, m_faceVertexIndices, m_normals, m_normalIndices, m_uvs, m_uvIndices, m_faceVertexCounts, m_topology.GetOrientation())) {
rprApi->SetMeshId(rprMesh, GetPrimId());
m_rprMeshes.push_back(rprMesh);
}
} else {
Expand Down Expand Up @@ -524,7 +535,6 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,
}

if (auto rprMesh = rprApi->CreateMesh(subsetPoints, subsetIndexes, subsetNormals, subsetNormalIndices, subsetUv, subsetUvIndices, subsetVertexPerFace, m_topology.GetOrientation())) {
rprApi->SetMeshId(rprMesh, GetPrimId());
m_rprMeshes.push_back(rprMesh);
++it;
} else {
Expand Down Expand Up @@ -664,7 +674,6 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,
int32_t meshId = GetPrimId();
for (int j = meshInstances.size(); j < newNumInstances; ++j) {
meshInstances.push_back(rprApi->CreateMeshInstance(m_rprMeshes[i]));
rprApi->SetMeshId(meshInstances.back(), meshId);
}
}
}
Expand Down Expand Up @@ -696,6 +705,24 @@ void HdRprMesh::Sync(HdSceneDelegate* sceneDelegate,
}
}

if (newMesh || isIdDirty) {
uint32_t id = m_id >= 0 ? uint32_t(m_id) : GetPrimId();
for (auto& rprMesh : m_rprMeshes) {
rprApi->SetMeshId(rprMesh, id);
}
for (auto& instances : m_rprMeshInstances) {
for (auto& rprMesh : instances) {
rprApi->SetMeshId(rprMesh, id);
}
}
}

if (newMesh || isIgnoreContourDirty) {
for (auto& rprMesh : m_rprMeshes) {
rprApi->SetMeshIgnoreContour(rprMesh, m_ignoreContour);
}
}

if (updateTransform) {
for (auto& rprMesh : m_rprMeshes) {
rprApi->SetTransform(rprMesh, m_transformSamples.count, m_transformSamples.times.data(), m_transformSamples.values.data());
Expand Down
4 changes: 3 additions & 1 deletion pxr/imaging/plugin/hdRpr/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class HdRprMesh final : public HdRprBaseRprim<HdMesh> {
HdDisplayStyle m_displayStyle;
int m_refineLevel = 0;

uint32_t m_visibilityMask;
int m_id = -1;
uint32_t m_visibilityMask = 0;
bool m_ignoreContour;
};

PXR_NAMESPACE_CLOSE_SCOPE
Expand Down
8 changes: 7 additions & 1 deletion pxr/imaging/plugin/hdRpr/primvarUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ limitations under the License.
PXR_NAMESPACE_OPEN_SCOPE

TF_DEFINE_PRIVATE_TOKENS(HdRprGeometryPrimvarTokens,
((id, "rpr:id"))
((subdivisionLevel, "rpr:subdivisionLevel"))
((ignoreContour, "rpr:ignoreContour"))
((visibilityPrimary, "rpr:visibilityPrimary"))
((visibilityShadow, "rpr:visibilityShadow"))
((visibilityReflection, "rpr:visibilityReflection"))
Expand Down Expand Up @@ -49,11 +51,15 @@ void HdRprParseGeometrySettings(
};

for (auto& desc : constantPrimvarDescs) {
if (desc.name == HdRprGeometryPrimvarTokens->subdivisionLevel) {
if (desc.name == HdRprGeometryPrimvarTokens->id) {
HdRprGetConstantPrimvar(HdRprGeometryPrimvarTokens->id, sceneDelegate, id, &geomSettings->id);
} else if (desc.name == HdRprGeometryPrimvarTokens->subdivisionLevel) {
int subdivisionLevel;
if (HdRprGetConstantPrimvar(HdRprGeometryPrimvarTokens->subdivisionLevel, sceneDelegate, id, &subdivisionLevel)) {
geomSettings->subdivisionLevel = std::max(0, std::min(subdivisionLevel, 7));
}
} else if (desc.name == HdRprGeometryPrimvarTokens->ignoreContour) {
HdRprGetConstantPrimvar(HdRprGeometryPrimvarTokens->ignoreContour, sceneDelegate, id, &geomSettings->ignoreContour);
} else if (desc.name == HdRprGeometryPrimvarTokens->visibilityPrimary) {
setVisibilityFlag(HdRprGeometryPrimvarTokens->visibilityPrimary, kVisiblePrimary);
} else if (desc.name == HdRprGeometryPrimvarTokens->visibilityShadow) {
Expand Down
Loading

0 comments on commit 4d66c92

Please sign in to comment.