Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression with 24.08 : Hio module does not support Monochrome EXR images #3289

Open
seando-adsk opened this issue Sep 12, 2024 · 3 comments
Labels
needs review Issue needing input/review by the repo maintainer (Pixar)

Comments

@seando-adsk
Copy link
Contributor

Description of Issue

We have a unit test in MayaUSD that reads OpenEXR images with 1, 2, and 4 channels in both half and float format to make sure every image type loads correctly.

Initially logged as issue #2800 which was fixed in 24.03/24.05. However the issue is back again in 24.08.

Looking at recent changes, replacing strIsRed() with a combined strIsComponent() suddenly lost the capability to decode a Y channel as being a potential red channel. Don't know if this is sufficient to cause the error we see though. Change is here.

The following patch gets us to:

diff --git a/pxr/imaging/hio/OpenEXR/openexr-c.c b/pxr/imaging/hio/OpenEXR/openexr-c.c
index 5c39b5adb..11464923d 100644
--- a/pxr/imaging/hio/OpenEXR/openexr-c.c
+++ b/pxr/imaging/hio/OpenEXR/openexr-c.c
@@ -657,7 +657,8 @@ static exr_result_t _nanoexr_rgba_decoding_initialize(
     for (int c = 0; c < decoder->channel_count; ++c) {
         int channelIndex = -1;
         decoder->channels[c].decode_to_ptr = NULL;
-        if (strIsComponent(layerName, decoder->channels[c].channel_name, "red")) {
+        if (strIsComponent(layerName, decoder->channels[c].channel_name, "red")
+            || strIsComponent(layerName, decoder->channels[c].channel_name, "y")) {
             rgba[0] = c;
             channelIndex = 0;
         }

image

So the only thing now missing is the expansion from "YA" to "YYYA" for the RG16F and RG32F images.

@meshula Would you be able to help with this?

Steps to Reproduce

  1. See Hio module does not support Monochrome EXR images #2800 for steps and files to use.

System Information (OS, Hardware)

Windows: heap corruption crash before the scene shows
Linux: Corrupted images

Package Versions

USD v24.08 with MaterialX v1.38.10

Build Flags

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10112

@meshula
Copy link
Member

meshula commented Sep 12, 2024

Do you have a usd file and images corresponding to your test that you could attach? Perhaps whatever is driving your screenshot?

@seando-adsk
Copy link
Contributor Author

Yes sure. In MayaUsd we have a unit test for this. It is part of our testVP2RenderDelegateMaterialX test, specifically the DemoQuads test which is failing. The reference image is DemoQuads_render.png. The usd file it loads is DemoQuads.usda

Sean

@nvmkuruc nvmkuruc added the needs review Issue needing input/review by the repo maintainer (Pixar) label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue needing input/review by the repo maintainer (Pixar)
Projects
None yet
Development

No branches or pull requests

4 participants