forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL workaround for structures with material fields (#1274)
The test cases in TestSuite/pbrlib/multioutput/multishaderoutput.mtlx generated invalid structs in MDL. This PR creates a separate function for each struct member, if at least one struct member is a material.
- Loading branch information
1 parent
ba759e0
commit 429a59c
Showing
5 changed files
with
202 additions
and
13 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
resources/Materials/TestSuite/pbrlib/multioutput/multishaderoutput.mtlx
This file contains 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,31 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38" xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
<nodegraph name="NG_multi_shader_output" nodedef="ND_multi_shader_output"> | ||
<burley_diffuse_bsdf name="burley_bsdf" type="BSDF"> | ||
<input name="color" type="color3" interfacename="diffuse_color" /> | ||
</burley_diffuse_bsdf> | ||
<dielectric_bsdf name="dielectric_bsdf" type="BSDF"> | ||
<input name="tint" type="color3" interfacename="diffuse_color" /> | ||
</dielectric_bsdf> | ||
<surface name="burley_surface" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="burley_bsdf" /> | ||
</surface> | ||
<surface name="dielectric_surface" type="surfaceshader"> | ||
<input name="bsdf" type="BSDF" nodename="dielectric_bsdf" /> | ||
</surface> | ||
<output name="burley_out" type="surfaceshader" nodename="burley_surface" /> | ||
<output name="dielectric_out" type="surfaceshader" nodename="dielectric_surface" /> | ||
</nodegraph> | ||
<nodedef name="ND_multi_shader_output" node="customtype" version="1.0" isdefaultversion="true"> | ||
<input name="diffuse_color" type="color3" value="0.25, 0.50, 0.75" /> | ||
<output name="burley_out" type="surfaceshader" /> | ||
<output name="dielectric_out" type="surfaceshader" /> | ||
</nodedef> | ||
<customtype name="customtype_1" type="multioutput"> | ||
<input name="diffuse_color" type="color3" value="0.25, 0.50, 0.75" /> | ||
<output name="burley_out" type="surfaceshader" value="" /> | ||
<output name="dielectric_out" type="surfaceshader" value="" /> | ||
</customtype> | ||
<output name="burley_out2" nodename="customtype_1" output="burley_out" type="surfaceshader" /> | ||
<output name="dielectric_out2" nodename="customtype_1" output="dielectric_out" type="surfaceshader" /> | ||
</materialx> |
This file contains 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 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 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 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