fix: SG-43392: Fix ACES 2 displaying black#1275
Conversation
Signed-off-by: TJ Jackson <tj.jackson@dreamworks.com>
Alternate, more hardcoded, but smaller solution for getting ACES 2 that could alternatively be added to shaderAddLutAsParameter |
There was a problem hiding this comment.
Looks great as is and is way better than my original primitive implementation !
Thank you @tjjackson !
|
FYI @tjjackson : I have a build error on our Autodesk jenkins pipeline on both Rocky 8 and Rocky 9 event though it shouldn't happen since we are building with gcc 11 (where std::regex_constants::multiline should be defined) |
|
I am not sure why it would be getting a build error regarding std::regex_constants::multiline, I didn't get any build issues in Rocky 9.7. But it did get me thinking about my current implementation, it is only matching against functions that start at col 0. maybe it should be more robust and match against functions whose previous non-whitespace character was either a ';' or '}'. That would get rid of the need for std::regex_constants::multiline and also match against top-level functions that for some reason have whitespace at the start of the line. |
Linked issues
Fixes #1010
Summarize your change.
Added logic to OCIOIPNode to pass LUT parameters to helper functions used by the GLSL shader function.
There is already a function in OCIOIPNode, shaderAddLutAsParameter(), to handle doing this for the shader function itself. I added functionality to to catch and update all cases where a LUT is being used inside of a function called by the shader. This should help future-proof the codebase for future OCIO GLSL changes.
There was also some discussion internal at our studio if it be better to use Slang or a similar library to handle the GLSL editing instead of manually text-parsing/editing, but I wasn't sure if the project wanted to add that as a dependency just for this one operation.
Alternatively, if we want to implement a smaller-scoped fix for the specific issue that was happening with ACES 2, I will put that fix in the comments.
Describe the reason for the change.
It appears that the GLSL shader function generated by OCIO 2.4 with ACES 2 is calling helper functions that in turn reference the LUTs. The OCIO GLSL assumes that these LUTs are global, but OpenRV expects them to be passed as function arguments. Since they are not, the image is displaying black.
Describe what you have tested and on which operating system.
Tested with a CY2025 build using an ACES 2 OCIO config on Rocky Linux 9.7. The results were signed off by our studio's color scientist.