PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.99k stars 1.18k forks source link

OpenEXR files with unconventional channel names load incorrectly #3238

Open JGamache-autodesk opened 3 weeks ago

JGamache-autodesk commented 3 weeks ago

Description of Issue

I had to debug a scene where one EXR image showed as reddish when used in USD. While debugging I happened to run iinfo to see if it had something irregular. In the Output I saw:

    channel list: R, G, B, channel3

The fourth channel has an unconventional name and this seems to trip the custom EXR loader found in USD to load channel3 data in the R channel of the loaded texture: image I suspect this fourth channel is an accident since OIIO uses that naming convention when trying to save two channels with the same name.

Steps to Reproduce

Take your favorite RGB EXR image and add an extra channel named channel3 using oiiotool:

oiiotool --ch R,G,B,channel3=1 my_image.exr -o my_unconventional_image.exr

Try to use this image in a Storm scene.

To reproduce the accidental scenario, use instead:

oiiotool --ch R,G,B,B my_image.exr -o my_unconventional_image.exr

Optionally, use this image: color_palette_ACEScg_channel3.zip

The message boards seem to indicate unconventional channel names is a common feature of many renderers, especially when using AOVs. This might require an extra input field in MaterialX and USD image nodes to map unconventional channel names to RGBA, which seems to be supported by OIIO.

System Information (OS, Hardware)

Package Versions

Build Flags

jesschimein commented 3 weeks ago

Filed as internal issue #USD-9997