anderslanglands / alShaders2

BSD 3-Clause "New" or "Revised" License
75 stars 38 forks source link

Add support for mixed bit depth EXRs #18

Closed jonahfriedman closed 6 years ago

jonahfriedman commented 6 years ago

As of Arnold 5.0.1, Arnold supports mixed bit depth. This is specified in output strings:

Half-float EXR layers: Output layers in files that support layers (such as regular or deep EXR files) can be individually set to type HALF by adding an optional HALF modifier to the corresponding output string. For instance: "my_aov RGB filter driver HALF". (#3839) (https://support.solidangle.com/display/A5ARP/5.0.1.0)

I'm pretty sure right now, doing this will cause incorrect interpretation of the output strings and probably break Cryptomatte. The code that reads these is currently here: https://github.com/anderslanglands/alShaders2/blob/master/cryptomatte/cryptomatte.cpp#L921-L931

If anyone takes this issue, please add tests for it. I think it'd be best if those were C++ tests, but adding such an output string to the test ass files wouldn't hurt either. For the C++ tests, I would first refactor that code into its own method under CryptomatteData that returns a struct of std::string members, and then add C++ tests for it to ensure it gets correct results for all the forms that output strings can take.

jonahfriedman commented 6 years ago

Done in 546cc3f.

If a driver will be set to full precision by Cryptomatte, all other outputs for that driver will be flagged as HALF, (including cryptomatte preview channels).