autodesk-forks / MaterialX

MaterialX C++ and Python libraries
http://www.materialx.org/
Apache License 2.0
107 stars 23 forks source link

FIx std surface transparency heuristic for opacity #1280

Closed bernardkwok closed 3 years ago

bernardkwok commented 3 years ago

Currently this always returns that all std surface shaders are transparent as the opacity input is mapped to a luminance node upstream within the implementation.

Previous code checked for a connected output for which there never is one for this configiration so was basically a pass-through. Current code checks to find an upstream node but in this case it should err on the side of not consider a luminance node to mark that the input is transparent. (i.e. getConnectedOutput() was modified to be getConnectedNode()).