OpenUSD
OpenUSD copied to clipboard
APPLE: Fix for primID rendering in AOVs
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
Filed as internal issue #USD-8291
Re-created here https://github.com/PixarAnimationStudios/OpenUSD/pull/2622/files
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).