Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (38 sloc) 1.66 KB
<?xml version="1.0" encoding="UTF-8"?>
<materialx version="1.36">
<!-- Parameter interface for a simple custom node -->
<!-- The "bg" input is required, while the "fg" input and "fgamt" parameter are optional. -->
<nodedef name="ND_blend_add_color3" node="blend_add" type="color3" defaultinput="bg">
<input name="fg" type="color3" value="0,0,0"/>
<input name="bg" type="color3"/>
<parameter name="fgamt" type="float" value="1.0"/>
<!-- Define the functionality of the color3-type "blend_add" node using a nodegraph -->
<!-- out = (fg * fgamt) + bg -->
<nodegraph name="NG_blend_add_color3" nodedef="ND_blend_add_color3">
<multiply name="n1" type="color3">
<input name="in1" type="color3" interfacename="fg"/>
<input name="in2" type="float" interfacename="fgamt"/>
<add name="n2" type="color3">
<input name="in1" type="color3" nodename="n1"/>
<input name="in2" type="color3" interfacename="bg"/>
<output name="o_result" type="color3" nodename="n2"/>
<!-- Use this custom node in a nodegraph -->
<nodegraph name="nodegraph1">
<image name="img1" type="color3">
<parameter name="file" type="filename" value="a.tif"/>
<image name="img2" type="color3">
<parameter name="file" type="filename" value="b.tif"/>
<blend_add name="bl1" type="color3">
<input name="fg" type="color3" nodename="img1"/>
<input name="bg" type="color3" nodename="img2"/>
<parameter name="fgamt" type="float" value="0.45"/>
<output name="blended" type="color3" nodename="bl1"/>