Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-channel connections adapter shader improperly connected #1175

Closed
dalorin opened this issue Jun 9, 2022 · 1 comment · Fixed by #1176
Closed

Per-channel connections adapter shader improperly connected #1175

dalorin opened this issue Jun 9, 2022 · 1 comment · Fixed by #1176
Labels
bug Something isn't working

Comments

@dalorin
Copy link

dalorin commented Jun 9, 2022

Pull request #352 was created to allow translation of per-channel connections in Arnold shader graphs to USD. This implementation is faulty as the inserted adapter shader (arnold:float_to_rgba) does not define an output connector and the connected shader node improperly connects to the adapter node itself rather than an output connector on the node. Despite this, the USD renders correctly in Maya's render view (non-Hydra). It does not render correctly through the Arnold delegate in Houdini Solaris.

To Reproduce
Steps to reproduce the behavior:

  1. Create a shader graph with per-channel connections, e.g. aiImage.r -> plusMinusAverage.r -> displacementShader (scalar displacement)
  2. Assign the shader to a mesh
  3. Use the Arnold scene exporter to export the mesh to USD
  4. Render the USD in Houdini Solaris

Expected behaviour
The mesh is rendered with displacement affected by the operation specified on the plusMinusAverage node.

Actual behaviour
The mesh is rendered without displacement.

Used Software Versions

  • Arnold: [e.g. 7.1.2.0]
  • MtoA: 5.1.3
  • Maya 2022.3
  • Houdini 18.5.696/19.0.513
  • OS: Centos 7

Additional context
Exported USD with invalid connection:

def Shader "plusMinusAverage1"
{
    uniform token info:id = "arnold:layer_rgba"
    bool inputs:enable3 = 0
    bool inputs:enable4 = 0
    bool inputs:enable5 = 0
    bool inputs:enable6 = 0
    bool inputs:enable7 = 0
    bool inputs:enable8 = 0
    color4f inputs:input1 = (0, 0, 0, 1)
    prepend color4f inputs:input1.connect = </rust_matdisplacementShader1/plusMinusAverage1_input1>
    color4f inputs:input2 = (-0.5, -0.5, -0.5, 1)
    token inputs:operation2 = "plus"
    color4f outputs:out
}

def Shader "plusMinusAverage1_input1"
{
    uniform token info:id = "arnold:float_to_rgba"
    float inputs:a = 1
    float inputs:b = 0
    prepend float inputs:b.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
    float inputs:g = 0
    prepend float inputs:g.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
    float inputs:r = 0
    prepend float inputs:r.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
}

Working USD with valid connection:

def Shader "plusMinusAverage1"
{
    uniform token info:id = "arnold:layer_rgba"
    bool inputs:enable3 = 0
    bool inputs:enable4 = 0
    bool inputs:enable5 = 0
    bool inputs:enable6 = 0
    bool inputs:enable7 = 0
    bool inputs:enable8 = 0
    color4f inputs:input1 = (0, 0, 0, 1)
    prepend color4f inputs:input1.connect = </rust_matdisplacementShader1/plusMinusAverage1_input1.outputs:out>
    color4f inputs:input2 = (-0.5, -0.5, -0.5, 1)
    token inputs:operation2 = "plus"
    color4f outputs:out
}

def Shader "plusMinusAverage1_input1"
{
    uniform token info:id = "arnold:float_to_rgba"
    float inputs:a = 1
    float inputs:b = 0
    prepend float inputs:b.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
    float inputs:g = 0
    prepend float inputs:g.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
    float inputs:r = 0
    prepend float inputs:r.connect = </rust_matdisplacementShader1/Metal025_4K_Displacement_1/uv.outputs:r>
    color4f outputs:out
}

Note the inclusion of the out connector on the adapter shader, and the specification of the out connector when specifying the input to the plusMinusAverage shader.

@dalorin dalorin added the bug Something isn't working label Jun 9, 2022
@sebastienblor
Copy link
Collaborator

Thanks for reporting @dalorin , sounds like a simple fix.
Indeed such a typo wouldn't affect the procedural, which is why our test scene is working properly. But hydra needs it to be setup correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants