Skip to content

Commit

Permalink
add HALF to the output description when needed (#2012)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpichard authored Jul 20, 2024
1 parent d935002 commit e54ac7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!-- SPDX-License-Identifier: Apache-2.0 -->
# Changelog

## Pending next bugfix release
- [usd#1989](https://github.com/Autodesk/arnold-usd/issues/1989) - Support mixed half/float channels when using the render delegate in batch mode with husk.


## Pending feature release

### Feature
Expand Down
6 changes: 5 additions & 1 deletion libs/render_delegate/render_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ void HdArnoldRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassSt
auto* enableFiltering = static_cast<bool*>(AiArrayMap(enableFilteringArray));
auto* halfPrecisionArray = AiArrayAllocate(numRenderVars, 1, AI_TYPE_BOOLEAN);
auto* halfPrecision = static_cast<bool*>(AiArrayMap(halfPrecisionArray));
const bool isDeepExrDriver = AiNodeIs(customProduct.driver, str::driver_deepexr);
for (const auto& renderVar : product.renderVars) {
CustomRenderVar customRenderVar;
*tolerance =
Expand Down Expand Up @@ -938,6 +939,9 @@ void HdArnoldRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassSt
if (!renderVar.name.empty() && renderVar.name != renderVar.sourceName) {
output += TfStringPrintf(" %s", renderVar.name.c_str());
}
if (arnoldTypes.isHalf && !isDeepExrDriver) {
output += " HALF";
}
customRenderVar.output = AtString{output.c_str()};
}
tolerance += 1;
Expand All @@ -950,7 +954,7 @@ void HdArnoldRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassSt
AiArrayUnmap(halfPrecisionArray);

// FIXME do we still need to do a special case for deep exr or should we generalize this ? #1422
if (AiNodeIs(customProduct.driver, str::driver_deepexr)) {
if (isDeepExrDriver) {
AiNodeSetArray(customProduct.driver, str::layer_tolerance, toleranceArray);
AiNodeSetArray(customProduct.driver, str::layer_enable_filtering, enableFilteringArray);
AiNodeSetArray(customProduct.driver, str::layer_half_precision, halfPrecisionArray);
Expand Down

0 comments on commit e54ac7e

Please sign in to comment.