-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add renderable examples of MaterialX 1.22 and 1.25 syntax, making it more straightforward to maintain older upgrade pathways over time. - Improve the upgrade logic for legacy shader nodedefs, allowing blocks of special-case code to be removed from MaterialXView and MaterialXGraphEditor. - Remove special-case unit tests for individual test documents, instead allowing these code paths to be covered by generic validation and shader generation for test suite materials. - Increases the measured code coverage of MaterialX unit tests from 87.4% to 88.1%.
- Loading branch information
1 parent
6bb5d1e
commit 6982dd7
Showing
12 changed files
with
135 additions
and
272 deletions.
There are no files selected for viewing
71 changes: 0 additions & 71 deletions
71
resources/Materials/TestSuite/stdlib/upgrade/1_38_parameter_to_input.mtlx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
resources/Materials/TestSuite/stdlib/upgrade/material_element_to_surface_material.mtlx
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
resources/Materials/TestSuite/stdlib/upgrade/syntax_1_22.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,70 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<materialx require="matopgraph" version="1.22"> | ||
<!-- | ||
Examples of MaterialX 1.22 syntax | ||
--> | ||
|
||
<opgraph name="carpaint_opgraph" colorspace="lin_rec709"> | ||
<constant name="base_constant" type="float"> | ||
<parameter name="color" type="float" value="0.5" /> | ||
</constant> | ||
<constant name="base_color_constant" type="color3"> | ||
<parameter name="color" type="color3" value="0.1037792, 0.59212029, 0.85064936" /> | ||
</constant> | ||
<constant name="specular_constant" type="float"> | ||
<parameter name="color" type="float" value="1.0" /> | ||
</constant> | ||
<constant name="specular_color_constant" type="color3"> | ||
<parameter name="color" type="color3" value="1.0, 1.0, 1.0" /> | ||
</constant> | ||
<constant name="specular_roughness_constant" type="float"> | ||
<parameter name="color" type="float" value="0.4" /> | ||
</constant> | ||
<constant name="specular_anisotropy_constant" type="float"> | ||
<parameter name="color" type="float" value="0.5" /> | ||
</constant> | ||
<constant name="coat_constant" type="float"> | ||
<parameter name="color" type="float" value="1.0" /> | ||
</constant> | ||
<constant name="coat_roughness_constant" type="float"> | ||
<parameter name="color" type="float" value="0.0" /> | ||
</constant> | ||
<output name="base_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="base_constant" /> | ||
</output> | ||
<output name="base_color_output" type="color3"> | ||
<parameter name="in" type="opgraphnode" value="base_color_constant" /> | ||
</output> | ||
<output name="specular_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="specular_constant" /> | ||
</output> | ||
<output name="specular_color_output" type="color3"> | ||
<parameter name="in" type="opgraphnode" value="specular_color_constant" /> | ||
</output> | ||
<output name="specular_roughness_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="specular_roughness_constant" /> | ||
</output> | ||
<output name="specular_anisotropy_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="specular_anisotropy_constant" /> | ||
</output> | ||
<output name="coat_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="coat_constant" /> | ||
</output> | ||
<output name="coat_roughness_output" type="float"> | ||
<parameter name="in" type="opgraphnode" value="coat_roughness_constant" /> | ||
</output> | ||
</opgraph> | ||
<shader name="carpaint_shader" shadertype="surface" shadername="standard_surface"> | ||
<input name="base" graphoutput="base_output" graphname="carpaint_opgraph" type="float" /> | ||
<input name="base_color" graphoutput="base_color_output" graphname="carpaint_opgraph" type="color3" /> | ||
<input name="specular" graphoutput="specular_output" graphname="carpaint_opgraph" type="float" /> | ||
<input name="specular_color" graphoutput="specular_color_output" graphname="carpaint_opgraph" type="color3" /> | ||
<input name="specular_roughness" graphoutput="specular_roughness_output" graphname="carpaint_opgraph" type="float" /> | ||
<input name="specular_anisotropy" graphoutput="specular_anisotropy_output" graphname="carpaint_opgraph" type="float" /> | ||
<input name="coat" graphoutput="coat_output" graphname="carpaint_opgraph" type="float" /> | ||
<input name="coat_roughness" graphoutput="coat_roughness_output" graphname="carpaint_opgraph" type="float" /> | ||
</shader> | ||
<material name="carpaint_material"> | ||
<shaderref name="carpaint_shader" shadertype="surface" /> | ||
</material> | ||
</materialx> |
28 changes: 28 additions & 0 deletions
28
resources/Materials/TestSuite/stdlib/upgrade/syntax_1_25.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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<materialx require="matopgraph" version="1.25" colorspace="lin_rec709"> | ||
<!-- | ||
Examples of MaterialX 1.25 syntax | ||
--> | ||
|
||
<shader name="standard_surface" shadertype="surface" shaderprogram="standard_surface"> | ||
<input name="base" type="float" value="1.0" publicname="base_public" /> | ||
<input name="base_color" type="color3" value="0.8, 0.8, 0.8" publicname="base_color_public" /> | ||
<input name="specular" type="float" value="1.0" publicname="specular_public" /> | ||
<input name="specular_color" type="color3" value="1.0, 1.0, 1.0" publicname="specular_color_public" /> | ||
<input name="specular_roughness" type="float" value="0.2" publicname="specular_roughness_public" /> | ||
<input name="specular_anisotropy" type="float" value="0.0" publicname="specular_anisotropy_public" /> | ||
<input name="coat" type="float" value="0.0" publicname="coat_public" /> | ||
<input name="coat_roughness" type="float" value="0.1" publicname="coat_roughness_public" /> | ||
</shader> | ||
<material name="carpaint"> | ||
<shaderref name="standard_surface" shadertype="surface" /> | ||
<override name="base_public" type="float" value="0.5" /> | ||
<override name="base_color_public" type="color3" value="0.1037792, 0.59212029, 0.85064936" /> | ||
<override name="specular_public" type="float" value="1.0" /> | ||
<override name="specular_color_public" type="color3" value="1.0, 1.0, 1.0" /> | ||
<override name="specular_roughness_public" type="float" value="0.4" /> | ||
<override name="specular_anisotropy_public" type="float" value="0.5" /> | ||
<override name="coat_public" type="float" value="1.0" /> | ||
<override name="coat_roughness_public" type="float" value="0.0" /> | ||
</material> | ||
</materialx> |
4 changes: 1 addition & 3 deletions
4
...estSuite/stdlib/upgrade/1_36_to_1_37.mtlx → ...TestSuite/stdlib/upgrade/syntax_1_36.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
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
Oops, something went wrong.