-
Notifications
You must be signed in to change notification settings - Fork 433
Fix interface input resolution in ShaderGen #2369
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
Merged
jstone-lucasfilm
merged 4 commits into
AcademySoftwareFoundation:main
from
kwokcb:interfaceinput_resolve
May 20, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e38fcf8
Fix up node creation and node instance interface input value assignment.
kwokcb 7dd442f
Add test file for material roots on tokenized upstream graph inputs.
kwokcb af8382a
Merge branch 'AcademySoftwareFoundation:main' into interfaceinput_res…
kwokcb 600e17a
Merge branch 'main' into interfaceinput_resolve
jstone-lucasfilm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
resources/Materials/TestSuite/stdlib/texture/token_graph_material.mtlx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <?xml version="1.0"?> | ||
| <materialx version="1.39"> | ||
| <nodegraph name="Parent_Token_Graph"> | ||
| <token name="Image_Name" type="string" value="cloth" uiname="Image Name" /> | ||
| <token name="Image_Extension" type="string" value="png" uiname="Image Extension" /> | ||
| <input name="Image_Filename" type="filename" uniform="true" value="resources/Images/[Image_Name].[Image_Extension]" /> | ||
| <tiledimage name="tiledimage" type="color3" nodedef="ND_tiledimage_color3"> | ||
| <input name="file" type="filename" uniform="true" interfacename="Image_Filename" /> | ||
| </tiledimage> | ||
| <output name="out" type="color3" nodename="tiledimage" /> | ||
| </nodegraph> | ||
| <nodegraph name="Sibling_Token"> | ||
| <tiledimage name="tiledimage" type="color3" nodedef="ND_tiledimage_color3"> | ||
| <token name="Image_Name" type="string" value="wood_color" uiname="Image Resolution" /> | ||
| <token name="Image_Extension" type="string" value="jpg" uiname="Image Extension" /> | ||
| <input name="file" type="filename" uniform="true" value="resources/images/[Image_Name].[Image_Extension]" /> | ||
| </tiledimage> | ||
| <output name="out" type="color3" nodename="tiledimage" /> | ||
| </nodegraph> | ||
| <token name="Brass_Image_Extension" type="string" value="jpg" uiname="Image Extension" /> | ||
| <nodegraph name="Tokenized_Image_top_level"> | ||
| <tiledimage name="tiledimage" type="color3" nodedef="ND_tiledimage_color3"> | ||
| <token name="Brass_Image_Extension" type="string" value="png" uiname="Image Extension" /> | ||
| <input name="file" type="filename" uniform="true" value="resources/Images/brass_color.[Brass_Image_Extension]" /> | ||
| </tiledimage> | ||
| <output name="out" type="color3" nodename="tiledimage" /> | ||
| </nodegraph> | ||
| <nodedef name="ND_token" node="token_image"> | ||
| <token name="Image_Name" type="string" value="grid" uiname="Image Name" /> | ||
| <token name="Image_Extension" type="string" value="png" uiname="Image Extension" /> | ||
| <output name="out" type="color3" /> | ||
| </nodedef> | ||
| <nodegraph name="NG_token" nodedef="ND_token"> | ||
| <tiledimage name="tiledimage" type="color3" nodedef="ND_tiledimage_color3"> | ||
| <input name="file" type="filename" uniform="true" value="resources/Images/[Image_Name].[Image_Extension]" /> | ||
| </tiledimage> | ||
| <output name="out" type="color3" nodename="tiledimage" /> | ||
| </nodegraph> | ||
| <nodegraph name="token_nodedef_graph"> | ||
| <token_image name="token_image1" type="color3" /> | ||
| <output name="out" type="color3" nodename="token_image1" /> | ||
| </nodegraph> | ||
| <surface_unlit name="Parent_Token_Shader" type="surfaceshader"> | ||
| <input name="emission_color" type="color3" output="out" nodegraph="Parent_Token_Graph" /> | ||
| </surface_unlit> | ||
| <surface_unlit name="Token_Nodedef_Shader" type="surfaceshader"> | ||
| <input name="emission_color" type="color3" output="out" nodegraph="token_nodedef_graph" /> | ||
| </surface_unlit> | ||
| <surface_unlit name="TopLevel_Token_Shader" type="surfaceshader"> | ||
| <input name="emission_color" type="color3" output="out" nodegraph="Tokenized_Image_top_level" /> | ||
| </surface_unlit> | ||
| <surface_unlit name="Token_Silbing_Shader" type="surfaceshader"> | ||
| <input name="emission_color" type="color3" output="out" nodegraph="Sibling_Token" /> | ||
| </surface_unlit> | ||
| <surfacematerial name="Token_Silbing_Material" type="material"> | ||
| <input name="surfaceshader" type="surfaceshader" nodename="Token_Silbing_Shader" /> | ||
| </surfacematerial> | ||
| <surfacematerial name="Token_Nodedef_Material" type="material"> | ||
| <input name="surfaceshader" type="surfaceshader" nodename="Token_Nodedef_Shader" /> | ||
| </surfacematerial> | ||
| <surfacematerial name="TopLevel_Token_Material" type="material"> | ||
| <input name="surfaceshader" type="surfaceshader" nodename="TopLevel_Token_Shader" /> | ||
| </surfacematerial> | ||
| <surfacematerial name="Parent_Token_Material" type="material"> | ||
| <input name="surfaceshader" type="surfaceshader" nodename="Parent_Token_Shader" /> | ||
| </surfacematerial> | ||
| </materialx> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,7 +349,7 @@ void ShaderNode::initialize(const Node& node, const NodeDef& nodeDef, GenContext | |
| InputPtr interfaceInput = nodeInput->getInterfaceInput(); | ||
| if (interfaceInput) | ||
| { | ||
| portValue = interfaceInput->getValue(); | ||
| portValue = interfaceInput->getResolvedValue(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interface inputs on nodedefs should get the resolved value. |
||
| } | ||
| } | ||
| const string& valueString = portValue ? portValue->getValueString() : EMPTY_STRING; | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems interface input values were not being checked at all on node instances.