Skip to content

Commit

Permalink
Update node name gooch_shade
Browse files Browse the repository at this point in the history
Improve input names
  • Loading branch information
ashwinbhat committed Jan 25, 2024
1 parent bb049b5 commit b0d3f4c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions libraries/nprlib/nprlib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
</nodedef>

<!--
Node: <gooch>
Compute Gooch shading.
Node: <gooch_shade>
Compute Gooch Shading.
-->
<nodedef name="ND_gooch" node="gooch" doc="Compute Gooch shading">
<input name="Warm" type="color3" value="0.6, 0, 0" uiname="Warm Color" doc="Warm diffuse color"/>
<input name="Cool" type="color3" value="0, 0, 0.6" uiname="Cool Color" doc="Cool diffuse color"/>
<input name="Shininess" type="float" value="8" uimin="1" uimax="64" doc="Specular shininess"/>
<input name="SpecularColor" type="color3" value="0.6, 0.6, 0.6" uiname="Specular Color" doc="Specular color"/>
<input name="LightDirection" type="vector3" value="1, 0.5, 0.5" uiname="Light Direction" doc="Light vector"/>
<nodedef name="ND_gooch_shade" node="gooch_shade" doc="Compute Gooch shading">
<input name="warm_color" type="color3" value="0.6, 0, 0" uiname="Warm Color" doc="Warm diffuse color"/>
<input name="cool_color" type="color3" value="0, 0, 0.6" uiname="Cool Color" doc="Cool diffuse color"/>
<input name="shininess" type="float" value="8" uimin="1" uimax="64" doc="Specular shininess"/>
<input name="specular_color" type="color3" value="0.6, 0.6, 0.6" uiname="Specular Color" doc="Specular color"/>
<input name="light_direction" type="vector3" value="1, 0.5, 0.5" uiname="Light Direction" doc="Light vector"/>
<output name="out" type="color3" />
</nodedef>

Expand Down
12 changes: 6 additions & 6 deletions libraries/nprlib/nprlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@
<!--
Node: <gooch>
-->
<nodegraph name="NG_gooch" type="color3" nodedef="ND_gooch">
<nodegraph name="NG_gooch_shade" type="color3" nodedef="ND_gooch_shade">
<normal name="N" type="vector3">
<input name="space" type="string" value="world" />
</normal>
<normalize name="normalize" type="vector3">
<input name="in" type="vector3" interfacename="LightDirection" />
<input name="in" type="vector3" interfacename="light_direction" />
</normalize>
<dotproduct name="NdotL" type="float">
<input name="in1" type="vector3" nodename="N" />
<input name="in2" type="vector3" nodename="normalize" />
</dotproduct>
<mix name="diffuse" type="color3">
<input name="fg" type="color3" interfacename="Cool" />
<input name="bg" type="color3" interfacename="Warm" />
<input name="fg" type="color3" interfacename="cool_color" />
<input name="bg" type="color3" interfacename="warm_color" />
<input name="mix" type="float" nodename="max_float" />
</mix>
<power name="specular" type="float">
<input name="in1" type="float" nodename="max1" />
<input name="in2" type="float" interfacename="Shininess" />
<input name="in2" type="float" interfacename="shininess" />
</power>
<max name="max1" type="float">
<input name="in1" type="float" nodename="VdotR" />
Expand Down Expand Up @@ -112,7 +112,7 @@
</subtract>
<multiply name="multiply_color3FA" type="color3">
<input name="in2" type="float" nodename="specular" />
<input name="in1" type="color3" interfacename="SpecularColor" />
<input name="in1" type="color3" interfacename="specular_color" />
</multiply>
<add name="final_color" type="color3">
<input name="in1" type="color3" nodename="diffuse" />
Expand Down
24 changes: 12 additions & 12 deletions resources/Materials/Examples/npr/gooch_material.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
</tiledimage>

<gooch name="gooch1" type="color3">
<input name="Warm" type="color3" value="0.6, 0, 0"/>
<input name="Cool" type="color3" value="0, 0, 0.6"/>
<input name="LightDirection" type="vector3" value="0, 1, 1"/>
<input name="SpecularColor" type="color3" value="0.8, 0.8, 0.8"/>
</gooch>
<gooch_shade name="gooch1" type="color3">
<input name="warm_color" type="color3" value="0.6, 0, 0"/>
<input name="cool_color" type="color3" value="0, 0, 0.6"/>
<input name="light_direction" type="vector3" value="0, 1, 1"/>
<input name="specular_color" type="color3" value="0.8, 0.8, 0.8"/>
</gooch_shade>

<output name="out_basecolor" type="color3" nodename="gooch1" />
<output name="out_color" type="color3" nodename="image_color" />
Expand All @@ -36,12 +36,12 @@
<input name="surfaceshader" type="surfaceshader" nodename="SR_brass1" />
</surfacematerial>

<gooch name="gooch_color" type="color3">
<input name="Warm" type="color3" value="0.6, 0, 0" />
<input name="Cool" type="color3" value="0, 0, 0.6" />
<input name="LightDirection" type="vector3" value="0, 1, 1"/>
<input name="SpecularColor" type="color3" value="0.8, 0.8, 0.8"/>
</gooch>
<gooch_shade name="gooch_color" type="color3">
<input name="warm_color" type="color3" value="0.6, 0, 0" />
<input name="cool_color" type="color3" value="0, 0, 0.6" />
<input name="light_direction" type="vector3" value="0, 1, 1"/>
<input name="specular_color" type="color3" value="0.8, 0.8, 0.8"/>
</gooch_shade>
<surface_unlit name="unlit_surface" type="surfaceshader">
<input name="emission_color" type="color3" nodename="gooch_color" />
<input name="opacity" type="float" value="1.0" />
Expand Down
14 changes: 7 additions & 7 deletions resources/Materials/TestSuite/nprlib/gooch.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<!-- ======================================================================== -->

<!--
Node: <gooch>
Node: <gooch_shade>
-->
<gooch name="gooch1" type="color3">
<input name="Warm" type="color3" value="0.701712, 0.37992, 0.111519" />
<input name="Cool" type="color3" value="0.073756, 0, 0.486553" />
<input name="Shininess" type="float" value="10" />
<input name="SpecularColor" type="color3" value="0.929095, 0.603842, 0.0817786" />
</gooch>
<gooch_shade name="gooch1" type="color3">
<input name="warm_color" type="color3" value="0.701712, 0.37992, 0.111519" />
<input name="cool_color" type="color3" value="0.073756, 0, 0.486553" />
<input name="shininess" type="float" value="10" />
<input name="specular_color" type="color3" value="0.929095, 0.603842, 0.0817786" />
</gooch_shade>
<surface_unlit name="unlit_surface" type="surfaceshader">
<input name="emission_color" type="color3" nodename="gooch1" />
<input name="opacity" type="float" value="1.0" />
Expand Down

0 comments on commit b0d3f4c

Please sign in to comment.