forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resurrecting previous work by Bernard Kwok to implement Gooch shader
- Loading branch information
1 parent
b48057e
commit e927c21
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38"> | ||
<!-- | ||
Copyright Contributors to the MaterialX Project | ||
SPDX-License-Identifier: Apache-2.0 | ||
Graph definitions of nprlib nodes included in the MaterialX specification. | ||
--> | ||
|
||
<nodegraph name="IMPL_gooch" nodedef="ND_gooch"> | ||
<add name="add" type="vector3" > | ||
<input name="in1" type="vector3" nodename="light" /> | ||
<input name="in2" type="vector3" nodename="light" /> | ||
</add> | ||
<add name="add1" type="color3" > | ||
<input name="in1" type="color3" nodename="mix" /> | ||
<input name="in2" type="float" nodename="max1" /> | ||
</add> | ||
<dotproduct name="dotproduct" type="float" > | ||
<input name="in1" type="vector3" interfacename="normal" /> | ||
<input name="in2" type="vector3" nodename="normalize" /> | ||
</dotproduct> | ||
<dotproduct name="dotproduct1" type="float" > | ||
<input name="in1" type="vector3" interfacename="normal" /> | ||
<input name="in2" type="vector3" nodename="normalize1" /> | ||
</dotproduct> | ||
<constant name="light" type="vector3" > | ||
<input name="value" type="vector3" interfacename="light_dir" /> | ||
</constant> | ||
<max name="max1" type="float" > | ||
<input name="in1" type="float" nodename="power" /> | ||
</max> | ||
<mix name="mix" type="color3" > | ||
<input name="fg" type="color3" interfacename="cool_color" /> | ||
<input name="bg" type="color3" interfacename="warm_color" /> | ||
<input name="mix" type="float" nodename="dotproduct" /> | ||
</mix> | ||
<normalize name="normalize" type="vector3" > | ||
<input name="in" type="vector3" nodename="light" /> | ||
</normalize> | ||
<normalize name="normalize1" type="vector3" > | ||
<input name="in" type="vector3" nodename="add" /> | ||
</normalize> | ||
<power name="power" type="float" > | ||
<input name="in1" type="float" nodename="dotproduct1" /> | ||
<input name="in2" type="float" value="32" /> | ||
</power> | ||
<uniform_edf name="uniform_edf" type="EDF" > | ||
<input name="color" type="color3" nodename="add1" /> | ||
</uniform_edf> | ||
<surface name="gooch_shader" type="surfaceshader" > | ||
<input name="bsdf" type="BSDF" value="" /> | ||
<input name="edf" type="EDF" nodename="uniform_edf" /> | ||
<input name="opacity" type="float" value="1" /> | ||
</surface> | ||
<output name="out" type="surfaceshader" nodename="gooch_shader" /> | ||
</nodegraph> | ||
</materialx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38"> | ||
|
||
<gooch name="SR_Gooch_Material" type="surfaceshader"> | ||
<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_dir" type="vector3" value="0, 1, 1"/> | ||
</gooch> | ||
<surfacematerial name="Gooch_Material" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="SR_Gooch_Material" /> | ||
</surfacematerial> | ||
|
||
</materialx> |