OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

APPLE: Fix for primID rendering in AOVs

Open creijon opened this issue 1 year ago • 4 comments

Description of Change(s)

When rendering primID as an AOV, the IntToVec4 function originally packed the 32-bit ID into all 4 channels, which will correspond to RGBA. However, using A for the top 8 bits causes problems. First, somewhere downstream RGB will be premultiplied by A and information will be lost. Second, when these end up in an output image, there is no way to know what pixels have valid IDs, unless we pick a specific RGBA like (0,0,0,0) to mean "no object".

While this means we can only handle 16 million IDs, this seems to be the safest option right now. See similar code in frameRecorder.cpp which interprets these values.

Thanks to the wider team at Apple for this.

Fixes Issue(s)

  • Incorrect output in primID AOV
  • [X] I have verified that all unit tests pass with the proposed changes
  • [X] I have submitted a signed Contributor License Agreement

creijon avatar May 03 '23 10:05 creijon

Filed as internal issue #USD-8291

tallytalwar avatar May 03 '23 18:05 tallytalwar

Re-created here https://github.com/PixarAnimationStudios/OpenUSD/pull/2622/files

slingthor avatar Nov 07 '23 17:11 slingthor

/AzurePipelines run

jesschimein avatar Mar 13 '24 20:03 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 13 '24 20:03 azure-pipelines[bot]