Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (88 sloc) 4.08 KB
<?xml version="1.0" encoding="UTF-8"?>
<materialx version="1.36" cms="ocio" colorspace="lin_rec709">
<!-- Define a node that implements a checker board pattern -->
<!-- Using a graph for the implementation. -->
<nodedef name="ND_checker_float" node="checker" type="float">
<input name="scale" type="vector2" value="8.0, 8.0"/>
</nodedef>
<nodegraph name="IM_checker_float" nodedef="ND_checker_float">
<texcoord name="texcoord1" type="vector2">
<parameter name="index" type="integer" value="0"/>
</texcoord>
<multiply name="mult1" type="vector2">
<input name="in1" type="vector2" nodename="texcoord1"/>
<input name="in2" type="vector2" interfacename="scale"/>
</multiply>
<swizzle name="swizz_x" type="float">
<input name="in" type="vector2" nodename="mult1"/>
<parameter name="channels" type="string" value="x"/>
</swizzle>
<swizzle name="swizz_y" type="float">
<input name="in" type="vector2" nodename="mult1"/>
<parameter name="channels" type="string" value="y"/>
</swizzle>
<floor name="floor1" type="float">
<input name="in" type="float" nodename="swizz_x"/>
</floor>
<floor name="floor2" type="float">
<input name="in" type="float" nodename="swizz_y"/>
</floor>
<add name="add1" type="float">
<input name="in1" type="float" nodename="floor1"/>
<input name="in2" type="float" nodename="floor2"/>
</add>
<modulo name="mod1" type="float">
<input name="in1" type="float" nodename="add1"/>
<input name="in2" type="float" value="2.0"/>
</modulo>
<output name="out" type="float" nodename="mod1"/>
</nodegraph>
<!-- Define a node that uses the checker pattern for mixing two colors. -->
<!-- Using a graph for the implementation. checker1 becomes a sub-graph. -->
<nodedef name="ND_color_checker_color3" node="color_checker" type="color3">
<input name="color1" type="color3" value="0.8, 0.2, 0.1"/>
<input name="color2" type="color3" value="0.1, 0.1, 0.8"/>
<input name="scale" type="vector2" value="8.0, 8.0"/>
</nodedef>
<nodegraph name="IM_color_checker_color3" nodedef="ND_color_checker_color3">
<checker name="checker1" type="float">
<input name="scale" type="vector2" interfacename="scale"/>
</checker>
<mix name="mix1" type="color3">
<input name="fg" type="color3" interfacename="color1"/>
<input name="bg" type="color3" interfacename="color2"/>
<input name="mix" type="float" nodename="checker1"/>
</mix>
<output name="out" type="color3" nodename="mix1"/>
</nodegraph>
<!-- Example1: Applying a color checker pattern to an image texture. -->
<!-- Showing subgraphs with multiple levels. -->
<nodegraph name="subgraph_ex1">
<constant name="c1" type="color3">
<parameter name="value" type="color3" value="1.0,0.0,0.0"/>
</constant>
<constant name="c2" type="color3">
<parameter name="value" type="color3" value="0.0,1.0,0.0"/>
</constant>
<constant name="scale1" type="vector2">
<parameter name="value" type="vector2" value="8.0, 8.0"/>
</constant>
<texcoord name="texcoord2" type="vector2">
<parameter name="index" type="integer" value="0"/>
</texcoord>
<image name="image1" type="color3">
<parameter name="file" type="filename" value="image.tif"/>
<input name="texcoord" type="vector2" nodename="texcoord2"/>
</image>
<color_checker name="checker1" type="color3">
<input name="color1" type="color3" nodename="c1"/>
<input name="color2" type="color3" nodename="c2"/>
<input name="scale" type="vector2" nodename="scale1"/>
</color_checker>
<multiply name="multiply1" type="color3">
<input name="in1" type="color3" nodename="image1"/>
<input name="in2" type="color3" nodename="checker1"/>
</multiply>
<output name="out" type="color3" nodename="multiply1"/>
</nodegraph>
</materialx>
You can’t perform that action at this time.