AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.83k stars 336 forks source link

Graph Editor: outputs of split nodes are not correctly evaluated (invert node is not applied) #1472

Closed marwie closed 1 year ago

marwie commented 1 year ago

The following nodegraph has a invert node connected to a separate3 output slot. Open the nodegraph and change the the value for in2 in the leftmost combine_vector3 node

Expected: value of 1 produces rough material Actual: value of 1 produces glossy material

<?xml version="1.0"?>
<materialx version="1.38" >
    <nodegraph name="needle_shadergraph" >
        <combine3 name="combine_vector3" type="vector3" >
            <input name="in1" type="float" value="0.0" />
            <input name="in2" type="float" value="0.0" />
            <input name="in3" type="float" value="1.0" />
        </combine3>
        <separate3 name="Split" type="multioutput" >
            <input name="in" type="vector3" nodename="combine_vector3" />
        </separate3>
        <invert name="invert" type="float" >
            <input name="in" type="float" output="outy" nodename="Split" />
        </invert>
        <convert name="float_to_color3" type="color3" >
            <input name="in" type="float" output="outx" nodename="Split" />
        </convert>
        <output name="base_color" type="color3" nodename="float_to_color3" />
        <output name="specular_roughness" type="float" nodename="invert" />
    </nodegraph>
    <standard_surface name="needle_standard_surface" type="surfaceshader" >
        <input name="base_color" type="color3" nodegraph="needle_shadergraph" output="base_color" />
        <input name="specular_roughness" type="float" nodegraph="needle_shadergraph" output="specular_roughness" />
    </standard_surface>
    <surfacematerial name="Default" type="material" >
        <input name="surfaceshader" type="surfaceshader" nodename="needle_standard_surface" />
    </surfacematerial>
</materialx>

https://github.com/AcademySoftwareFoundation/MaterialX/assets/5083203/338ac4eb-16cb-4928-9dc6-13e1e90f67bf

marwie commented 1 year ago

This also happens with the latest version on main 2d12c1687887f793609133cadf192bf4b29e9502

image

jstone-lucasfilm commented 1 year ago

@marwie It looks like this issue has been addressed in the MaterialX 1.38.8 release, very likely as part of the improvements to multioutput node connections implemented by @kwokcb.