Autodesk / Autodesk/arnold-usd

Multiple output support for shaders (Procedural)

Open
#910 4 comments 0 reactions 0 assignees View on GitHub
enhancement procedural writer
Dominant language
Python
Stars
284
Forks
68
Avg merge
2d 19h
Merged PRs (30d)
14

Description

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 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.

Contributor guide

Open the contributing guide

Research direction

Start by examining the referenced default.py createUsdShaderOutput call and the attached usda example. Trace how output names and component connections are represented in the USD writer, including the proposed ':' to '.' mapping for Arnold linking. Done means shaders support multiple named outputs and their component outputs without invalid USD attribute names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.