Skip to content

Commit

Permalink
Fixup MXResoures (libraries and resources).
Browse files Browse the repository at this point in the history
Signed-off-by: furby™ <[email protected]>
  • Loading branch information
furby-tm committed Sep 18, 2024
1 parent 0fdc4d9 commit 4663bf2
Show file tree
Hide file tree
Showing 121 changed files with 10,754 additions and 1,413 deletions.
4 changes: 4 additions & 0 deletions Sources/MXResources/Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(NOT SKBUILD)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION "resources" MESSAGE_NEVER)
endif()
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.38" colorspace="lin_rec709">

<!-- Custom node: <viewdir> -->
<!-- Required by environment shader graph below -->
<nodedef name="ND_viewdir_vector3" node="viewdir">
<output name="out" type="vector3" default="0.0, 0.0, 1.0" />
</nodedef>
<implementation name="IM_viewdir_vector3_genglsl" nodedef="ND_viewdir_vector3" target="genglsl" />
<implementation name="IM_viewdir_vector3_genmsl" nodedef="ND_viewdir_vector3" target="genmsl" />
<nodegraph name="environmentDraw">
<nodegraph name="envMap">

<!-- Get view direction -->
<viewdir name="viewDir" type="vector3" />
<viewdirection name="viewDir" type="vector3" />

<!-- Compute longitude coordinate -->
<atan2 name="angleXZ" type="float">
Expand Down Expand Up @@ -46,14 +39,19 @@
<input name="in2" type="float" nodename="latitude" />
</combine2>
<image name="envImage" type="color3">
<input name="file" type="filename" value="resources/Lights/san_giuseppe_bridge.hdr" uniform="true" />
<input name="file" type="filename" value="resources/Lights/san_giuseppe_bridge.hdr" />
<input name="texcoord" type="vector2" nodename="mapUvs" />
<input name="uaddressmode" type="string" value="periodic" uniform="true" />
<input name="vaddressmode" type="string" value="clamp" uniform="true" />
<input name="filtertype" type="string" value="linear" uniform="true" />
<input name="uaddressmode" type="string" value="periodic" />
<input name="vaddressmode" type="string" value="clamp" />
<input name="filtertype" type="string" value="linear" />
</image>

<multiply name="envImageAdjusted" type="color3">
<input name="in1" type="color3" nodename="envImage" />
<input name="in2" type="float" value="1.0" />
</multiply>

<!-- Return the resulting color -->
<output name="out" type="color3" nodename="envImage" />
<output name="out" type="color3" nodename="envImageAdjusted" />
</nodegraph>
</materialx>
51 changes: 1 addition & 50 deletions Sources/MXResources/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 @@ -91,41 +74,9 @@
<input name="extraLibraryPaths" type="string" value="" />

<!-- List of document paths for render tests -->
<input name="renderTestPaths" type="string" value="resources/Materials/Examples/StandardSurface,resources/Materials/TestSuite/stdlib/color_management,resources/Materials/TestSuite/stdlib/convolution,resources/Materials/TestSuite/stdlib/geometric,resources/Materials/TestSuite/stdlib/noise,resources/Materials/TestSuite/pbrlib" />
<input name="renderTestPaths" type="string" value="resources/Materials/Examples/StandardSurface,resources/Materials/TestSuite/stdlib/color_management,resources/Materials/TestSuite/stdlib/convolution,resources/Materials/TestSuite/stdlib/geometric,resources/Materials/TestSuite/stdlib/procedural,resources/Materials/TestSuite/pbrlib,resources/Materials/TestSuite/nprlib" />

<!-- 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
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<nodegraph name="edge_brighten">
<facingratio name="facingratio_float" type="float">
<input name="invert" type="boolean" value="true" />
</facingratio>
<power name="power_float" type="float">
<input name="in1" type="float" nodename="facingratio_float" />
<input name="in2" type="float" value="3.0" />
</power>
<mix name="mix_color3" type="color3">
<input name="bg" type="color3" value="0, 0.0986187, 0.186275" />
<input name="fg" type="color3" value="0.735294, 0.735294, 0.735294" />
<input name="mix" type="float" nodename="power_float" />
</mix>
<output name="out" type="color3" nodename="mix_color3" />
</nodegraph>
</materialx>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<materialx version="1.38">

<gooch_shade name="default_gooch" type="color3">
<input name="warm_color" type="color3" value="0.8, 0.8, 0.7" />
<input name="cool_color" type="color3" value="0.3, 0.3, 0.8" />
<input name="specular_intensity" type="float" value="1" />
<input name="shininess" type="float" value="64" />
</gooch_shade>
<surface_unlit name="unlit_surface" type="surfaceshader">
<input name="emission_color" type="color3" nodename="default_gooch" />
</surface_unlit>
<surfacematerial name="default_gooch_material" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="unlit_surface" />
</surfacematerial>

<gooch_shade name="red_blue_gooch" type="color3">
<input name="warm_color" type="color3" value="0.9, 0.1, 0.1" />
<input name="cool_color" type="color3" value="0.1, 0.1, 0.9" />
<input name="specular_intensity" type="float" value="1" />
<input name="shininess" type="float" value="64" />
</gooch_shade>
<surface_unlit name="redblue_gooch_surface" type="surfaceshader">
<input name="emission_color" type="color3" nodename="red_blue_gooch" />
</surface_unlit>
<surfacematerial name="redblue_gooch_material" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="redblue_gooch_surface" />
</surfacematerial>

</materialx>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<nodegraph name="starfield">
<viewdirection name="viewDir" type="vector3" />
<multiply name="multiply_vector3FA" type="vector3">
<input name="in1" type="vector3" nodename="viewDir" />
<input name="in2" type="float" value="260" />
</multiply>
<noise3d name="noise3d_float" type="float">
<input name="position" type="vector3" nodename="multiply_vector3FA" />
</noise3d>
<contrast name="contrast_float" type="float">
<input name="in" type="float" nodename="noise3d_float" />
<input name="amount" type="float" value="5" />
<input name="pivot" type="float" value="0.8" />
</contrast>
<clamp name="clamp_float" type="float">
<input name="in" type="float" nodename="contrast_float" />
</clamp>
<convert name="convert_float_color3" type="color3">
<input name="in" type="float" nodename="clamp_float" />
</convert>
<output name="out" type="color3" nodename="convert_float_color3" />
</nodegraph>
</materialx>
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?xml version="1.0"?>
<materialx version="1.38">
<surface_unlit name="surface_unlit" type="surfaceshader">
<input name="emission_color" type="color3" nodename="toon_shade1" />
</surface_unlit>
<surfacematerial name="surfacematerial" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="surface_unlit" />
</surfacematerial>
<nodedef name="ND_toon_sample" node="toon_shade" namespace="npr_test" doc="Sample Toon Shader">
<input name="base_color" type="color3" value="0.0156384, 0.632771, 0.799511" uiname="Base Color" />
<input name="ambient_color" type="color3" value="0.574572, 0.207914, 0.207914" uiname="Ambient Color" />
<input name="specular_color" type="color3" value="0.726161, 0.726161, 0.726161" uiname="Specular Color" />
<input name="glossiness" type="float" value="16" uiname="Glossiness" uimin="1" uimax="256" />
<input name="rim_color" type="color3" value="0.775061, 0.775061, 0.775061" uiname="Rim Color" />
<input name="light_direction" type="vector3" value="1.0, -0.5, -0.5" uiname="Light Direction" uimin="-1, -1, -1" uimax="1, 1, 1" />
<input name="light_color" type="color3" value="0.885086, 0.885086, 0.885086" uiname="Light Color" />
<output name="output_color3" type="color3" />
</nodedef>
<npr_test:toon_shade name="toon_shade1" type="color3">
<input name="base_color" type="color3" value="0.4, 0.4, 0.4" />
<input name="ambient_color" type="color3" value="0.1, 0.1, 0.1" />
<input name="specular_color" type="color3" value="0.769337, 0.872861, 0.599692" />
<input name="glossiness" type="float" value="16" />
<input name="rim_color" type="color3" value="0.5, 0.5, 0.5" />
<input name="light_direction" type="vector3" value="1, -0.5, -0.5" />
<input name="light_color" type="color3" value="0.968215, 0.968215, 0.968215" />
</npr_test:toon_shade>
<nodegraph name="NG_toon_sample" namespace="npr_test" nodedef="ND_toon_sample">
<output name="output_color3" type="color3" nodename="multiply_color3" />
<normal name="normal" type="vector3" >
<input name="space" type="string" value="world" />
</normal>
<dotproduct name="NdotL" type="float">
<input name="in1" type="vector3" nodename="unit_normal" />
<input name="in2" type="vector3" nodename="multiply_vector4" />
</dotproduct>
<normalize name="unit_light_direction" type="vector3">
<input name="in" type="vector3" interfacename="light_direction" />
</normalize>
<multiply name="multiply_color3" type="color3">
<input name="in1" type="color3" interfacename="base_color" />
<input name="in2" type="color3" nodename="add_color5" />
</multiply>
<add name="add_color3" type="color3">
<input name="in1" type="color3" nodename="gradient_light" />
<input name="in2" type="color3" interfacename="ambient_color" />
</add>
<smoothstep name="smooth_gradient" type="float">
<input name="in" type="float" nodename="NdotL" />
<input name="high" type="float" value="0.001" />
</smoothstep>
<viewdirection name="viewdirection_vector3" type="vector3" >
<input name="space" type="string" value="world" />
</viewdirection>
<normalize name="unit_viewdirection" type="vector3">
<input name="in" type="vector3" nodename="viewdirection_vector3" />
</normalize>
<multiply name="multiply_float" type="float">
<input name="in1" type="float" nodename="smooth_gradient" />
<input name="in2" type="float" nodename="max_float" />
</multiply>
<power name="specular_intensity_power" type="float">
<input name="in1" type="float" nodename="multiply_float" />
<input name="in2" type="float" interfacename="glossiness" />
</power>
<convert name="specular_intensity_color" type="color3">
<input name="in" type="float" nodename="specular_remap" />
</convert>
<add name="add_color4" type="color3">
<input name="in1" type="color3" nodename="add_color3" />
<input name="in2" type="color3" nodename="specular" />
</add>
<multiply name="multiply_vector3" type="vector3">
<input name="in1" type="vector3" nodename="unit_viewdirection" />
<input name="in2" type="vector3" value="-1, -1, -1" />
</multiply>
<smoothstep name="specular_remap" type="float">
<input name="in" type="float" nodename="specular_intensity_power" />
<input name="low" type="float" value="0.005" />
<input name="high" type="float" value="0.008" />
</smoothstep>
<multiply name="specular" type="color3">
<input name="in1" type="color3" nodename="specular_intensity_color" />
<input name="in2" type="color3" interfacename="specular_color" />
</multiply>
<dotproduct name="NdotV" type="float">
<input name="in1" type="vector3" nodename="unit_normal" />
<input name="in2" type="vector3" nodename="multiply_vector3" />
</dotproduct>
<invert name="NdotV_invert" type="float">
<input name="in" type="float" nodename="NdotV" />
</invert>
<add name="add_color5" type="color3">
<input name="in1" type="color3" nodename="add_color4" />
<input name="in2" type="color3" nodename="rim" />
</add>
<smoothstep name="rim_gradient" type="float">
<input name="in" type="float" nodename="rmi_intensity" />
<input name="low" type="float" nodename="add_float" />
<input name="high" type="float" nodename="subtract_float" />
</smoothstep>
<constant name="rim_amount" type="float">
<input name="value" type="float" value="0.7" />
</constant>
<add name="add_float" type="float">
<input name="in1" type="float" nodename="rim_amount" />
<input name="in2" type="float" value="0.01" />
</add>
<subtract name="subtract_float" type="float">
<input name="in1" type="float" nodename="rim_amount" />
<input name="in2" type="float" value="0.01" />
</subtract>
<multiply name="rmi_intensity" type="float">
<input name="in1" type="float" nodename="NdotV_invert" />
<input name="in2" type="float" nodename="rim_power" />
</multiply>
<constant name="rim_threshold" type="float">
<input name="value" type="float" value="0.1" />
</constant>
<power name="rim_power" type="float">
<input name="in1" type="float" nodename="NdotL" />
<input name="in2" type="float" nodename="rim_threshold" />
</power>
<multiply name="multiply_vector4" type="vector3">
<input name="in1" type="vector3" nodename="unit_light_direction" />
<input name="in2" type="vector3" value="-1, -1, -1" />
</multiply>
<normalize name="unit_normal" type="vector3">
<input name="in" type="vector3" nodename="normal" />
</normalize>
<multiply name="rim" type="color3">
<input name="in1" type="color3" interfacename="rim_color" />
<input name="in2" type="float" nodename="rim_gradient" />
</multiply>
<multiply name="gradient_light" type="color3">
<input name="in2" type="float" nodename="smooth_gradient" />
<input name="in1" type="color3" interfacename="light_color" />
</multiply>
<reflect name="reflect" type="vector3">
<input name="in" type="vector3" nodename="unit_viewdirection" />
<input name="normal" type="vector3" nodename="unit_normal" />
</reflect>
<dotproduct name="LdotV" type="float">
<input name="in2" type="vector3" nodename="reflect" />
<input name="in1" type="vector3" nodename="multiply_vector4" />
</dotproduct>
<max name="max_float" type="float">
<input name="in1" type="float" nodename="LdotV" />
</max>
</nodegraph>
</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

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
Loading

0 comments on commit 4663bf2

Please sign in to comment.