arnold-usd icon indicating copy to clipboard operation
arnold-usd copied to clipboard

Multiple output support for shaders

Open jhodgson opened this issue 3 years ago • 4 comments

We'd like to support connections between shaders using multiple outputs, currently we just have a default output and its component connections.

Here's an example of a usd file generated with multiple outputs for colors Q,R and component float outputs Q:r, Q:g, Q:b, R:r, R:g, R:b.

usda.zip

The usda file is generated representing components with the : separator since the . separator isn't supported in usd:

"/Applications/Houdini/Houdini18.5.499/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/husdshadertranslators/default.py", line 1350, in createUsdShaderOutput return usd_shader.CreateOutput( usd_shader_output_name, usd_type ) ErrorException: Error in 'pxrInternal_v0_20_pxrReserved_::SdfAttributeSpec::New' at line 73 in file src/usd/usd-20.08/USD-py2.7/pxr/usd/sdf/attributeSpec.cpp : 'Cannot create attribute spec on </materials/materiallibrary1/probablity1> with invalid name 'outputs:Q.g''

so we'll probably have to usd a : separator and map between Q:g and Q.g to support the component linking in Arnold in our usd writer.

jhodgson avatar Mar 18 '21 14:03 jhodgson

Based on what Alan commented in #910 , it's possible that the work is only on the usd writer side. We might find a separator character that usd accepts AND that arnold understands out of the box

sebastienblor avatar Nov 08 '21 10:11 sebastienblor

Issue synced internally to ARNOLD-13267

Possible duplicate of https://github.com/Autodesk/arnold-usd/issues/1459

AdrienHerubel avatar Mar 28 '23 17:03 AdrienHerubel

Issue synced internally to ARNOLD-13474