Skip to content

Commit

Permalink
Simplify render test suite (AcademySoftwareFoundation#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Feb 17, 2024
1 parent bbaeaba commit 1d5ac95
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 387 deletions.
49 changes: 0 additions & 49 deletions resources/Materials/TestSuite/_options.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@
can also be performed depending on the options enabled.
-->

<!-- nodedefs for custom test settings -->
<nodedef name="ND_BakingSettings" node="baker">
<input name="file" type="filename" />
<input name="uvmin" type="vector2" />
<input name="uvmax" type="vector2" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</nodedef>

<nodedef name="ND_WedgeRenderSettings" node="wedgerender">
<input name="file" type="filename" />
<input name="parameter" type="string" />
<input name="range" type="vector2" value="0.0, 1.0" />
<input name="steps" type="integer" value="1.0" />
</nodedef>


<!-- Render test Suite Options -->
<nodedef name="TestSuiteOptions">
<!-- List of comma separated file names acts as a filter to only test documents with these names -->
Expand Down Expand Up @@ -95,37 +78,5 @@

<!-- Enable reference quality rendering. Default is false. -->
<input name="enableReferenceQuality" type="boolean" value="false" />

<!-- Wedge rendering options -->
<wedgerender name="wedge_conductor">
<input name="file" type="filename" value="wedge_conductor.mtlx" />
<input name="parameter" type="string" value="test_conductor/roughness1/roughness" />
<input name="range" type="vector2" value="0.0, 1.0" />
<input name="steps" type="integer" value="4" />
</wedgerender>

<wedgerender name="wedge_conductor_2">
<input name="file" type="filename" value="wedge_conductor.mtlx" />
<input name="parameter" type="string" value="test_conductor/roughness1/anisotropy" />
<input name="range" type="vector2" value="0.3, 0.9" />
<input name="steps" type="integer" value="3" />
</wedgerender>

<!-- Bake rendering options: Currently only supports the genglsl_glsl400 shader generator -->
<baker name="mapped_surfaceshader">
<input name="file" type="filename" value="mapped_surfaceshader.mtlx" />
<input name="uvmin" type="vector2" value="0,0" />
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="normalmapped_surfaceshader">
<input name="file" type="filename" value="normalmapped_surfaceshader.mtlx" />
<input name="uvmin" type="vector2" value="0,0" />
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>
</nodedef>
</materialx>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<materialx version="1.38">
<nodegraph name="generalized_schlick_bsdf">
<nodegraph name="schlick_bsdf">
<generalized_schlick_bsdf name="schlick_R" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="color0" type="color3" value="0.7, 0.7, 0.7" />
Expand Down
25 changes: 0 additions & 25 deletions resources/Materials/TestSuite/pbrlib/bsdf/wedge_conductor.mtlx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<materialx version="1.38">
<nodegraph name="displacement_fractal3d_float" type="displacementshader">
<nodegraph name="fractal3d_float" type="displacementshader">
<position name="position1" type="vector3">
<input name="space" type="string" value="object" />
</position>
Expand All @@ -21,7 +21,7 @@
</displacement>
<output name="out" type="displacementshader" nodename="disp1" />
</nodegraph>
<nodegraph name="displacement_fractal3d_vector3" type="displacementshader">
<nodegraph name="fractal3d_vector3" type="displacementshader">
<position name="position1" type="vector3">
<input name="space" type="string" value="object" />
</position>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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">
<nodegraph name="NG_multi" nodedef="ND_multi">
<burley_diffuse_bsdf name="burley_bsdf" type="BSDF">
<input name="color" type="color3" interfacename="diffuse_color" />
</burley_diffuse_bsdf>
Expand All @@ -16,7 +16,7 @@
<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">
<nodedef name="ND_multi" 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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
<?xml version="1.0"?>
<materialx version="1.38">
<surfacematerial name="SurfaceMaterial_All_Mapped_NodeGraph_Mapped" type="material">
<input name="surfaceshader" type="surfaceshader" nodegraph="Surf_Displace_NodeGraph" output="out" />
<input name="displacementshader" type="displacementshader" nodegraph="Surf_Displace_NodeGraph" output="displacementshader" />
</surfacematerial>
<nodegraph name="Surf_Displace_NodeGraph">
<nodegraph name="NG_Blue">
<standard_surface name="standard_surface" type="surfaceshader">
<input name="base_color" type="color3" value="0.3, 0.3, 1" />
</standard_surface>
<displacement name="displacement" type="displacementshader" />
<output name="out" type="surfaceshader" nodename="standard_surface" />
<output name="displacementshader" type="displacementshader" nodename="displacement" />
</nodegraph>
<surfacematerial name="SurfaceMaterial_PinkNodeGraph" type="material">
<input name="surfaceshader" type="surfaceshader" nodegraph="Pink_surface_shader_in_graph" />
<input name="displacementshader" type="displacementshader" value="" />
<surfacematerial name="M_Blue" type="material">
<input name="surfaceshader" type="surfaceshader" nodegraph="NG_Blue" output="out" />
<input name="displacementshader" type="displacementshader" nodegraph="NG_Blue" output="displacementshader" />
</surfacematerial>
<nodegraph name="Pink_surface_shader_in_graph">

<nodegraph name="NG_Magenta">
<standard_surface name="standard_surface1" type="surfaceshader">
<input name="base_color" type="color3" value="1, 0, 1" />
</standard_surface>
<output name="out" type="surfaceshader" nodename="standard_surface1" />
</nodegraph>
<nodegraph name="White_SurfaceMaterial_In_NodeGraph">
<surfacematerial name="White_SurfaceMaterial" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="White_Shader" />
<input name="displacementshader" type="displacementshader" value="" />
</surfacematerial>
<standard_surface name="White_Shader" type="surfaceshader" />
<surfacematerial name="M_Magenta" type="material">
<input name="surfaceshader" type="surfaceshader" nodegraph="NG_Magenta" />
</surfacematerial>

<standard_surface name="SR_Orange" type="surfaceshader">
<input name="base_color" type="color3" value="1, 0.3, 0" />
</standard_surface>
<surfacematerial name="M_Orange" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="SR_Orange" />
</surfacematerial>

<nodegraph name="NG_White">
<ramp4 name="ramp4" type="color3">
<input name="valuetl" type="color3" value="0, 0, 1" />
<input name="valuetr" type="color3" value="1, 0, 0" />
<input name="valuebl" type="color3" value="0, 1, 0" />
<input name="valuebr" type="color3" value="0, 1, 1" />
</ramp4>
<output name="out" type="material" nodename="White_SurfaceMaterial" />
<standard_surface name="SR_White" type="surfaceshader" />
<surfacematerial name="M_White" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="SR_White" />
</surfacematerial>
<output name="out" type="material" nodename="M_White" />
</nodegraph>
<surfacematerial name="Orange_Top_Level_SurfaceMaterial" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="Orange_Top_level_surface_shader" />
<input name="displacementshader" type="displacementshader" value="" />
</surfacematerial>
<standard_surface name="Orange_Top_level_surface_shader" type="surfaceshader">
<input name="base_color" type="color3" value="1, 0.3, 0" />
</standard_surface>
<surfacematerial name="Fail_surfacematerial_No_Shader" type="material">

<surfacematerial name="M_EmptySurface" type="material">
<input name="surfaceshader" type="surfaceshader" value="" />
<input name="displacementshader" type="displacementshader" value="" />
</surfacematerial>
<volumematerial name="Fail_volumematerial_unsupported" type="material">
<volumematerial name="M_EmptyVolume" type="material">
<input name="volumeshader" type="volumeshader" value="" />
</volumematerial>
</materialx>
66 changes: 0 additions & 66 deletions source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,6 @@ bool TestSuiteOptions::readOptions(const std::string& optionFile)
const std::string EXTRA_LIBRARY_PATHS("extraLibraryPaths");
const std::string RENDER_TEST_PATHS("renderTestPaths");
const std::string ENABLE_REFERENCE_QUALITY("enableReferenceQuality");
const std::string WEDGE_SETTING("wedgerender");
const std::string BAKER_SETTINGS("baker");

overrideFiles.clear();
dumpGeneratedCode = false;
Expand All @@ -983,70 +981,6 @@ bool TestSuiteOptions::readOptions(const std::string& optionFile)
mx::NodeDefPtr optionDefs = doc->getNodeDef(RENDER_TEST_OPTIONS_STRING);
if (optionDefs)
{
// Read Wedge Render Settings
for (mx::ElementPtr p : optionDefs->getChildrenOfType<mx::Element>(WEDGE_SETTING))
{
WedgeSetting setting;
for (auto child : p->getChildren())
{
mx::InputPtr input = child->asA<mx::Input>();
const std::string& name = input->getName();
mx::ValuePtr val = input->getValue();

if (name == "file")
{
setting.wedgeFile = val->asA<std::string>();
}
else if (name == "parameter")
{
setting.parameter = val->asA<std::string>();
}
else if (name == "range")
{
setting.range = val->asA<mx::Vector2>();
}
else if (name == "steps")
{
setting.steps = val->asA<int>();
}
}
wedgeSettings.push_back(setting);
}

// Read Baker Settings
for (mx::ElementPtr p : optionDefs->getChildrenOfType<mx::Element>(BAKER_SETTINGS))
{
BakeSetting setting;
for (auto child : p->getChildren())
{
mx::InputPtr input = child->asA<mx::Input>();
const std::string& name = input->getName();
mx::ValuePtr val = input->getValue();

if (name == "file")
{
setting.bakeFile = val->asA<std::string>();
}
else if (name == "resolution")
{
setting.resolution = val->asA<int>();
}
else if (name == "hdr")
{
setting.hdr = val->asA<bool>();
}
else if (name == "uvmin")
{
setting.uvmin = val->asA<mx::Vector2>();
}
else if (name == "uvmax")
{
setting.uvmax = val->asA<mx::Vector2>();
}
}
bakeSettings.push_back(setting);
}

for (auto p : optionDefs->getInputs())
{
const std::string& name = p->getName();
Expand Down
10 changes: 0 additions & 10 deletions source/MaterialXTest/MaterialXGenShader/GenShaderUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,6 @@ class TestSuiteOptions
// Enable reference quality rendering. Default is false.
bool enableReferenceQuality;

// Wedge parameters
struct WedgeSetting
{
std::string wedgeFile;
std::string parameter;
mx::Vector2 range;
int steps;
};
std::vector <WedgeSetting> wedgeSettings;

// Bake parameters
struct BakeSetting
{
Expand Down
Loading

0 comments on commit 1d5ac95

Please sign in to comment.