Skip to content

Commit

Permalink
Improvements to triplanar blending (AcademySoftwareFoundation#1350)
Browse files Browse the repository at this point in the history
Fixes triplanar node's blending, so the corner's are not bright. Also adds a blend control for users to adjust the blending between maps. The default blend value of 1.0 matches the original behavior (apart from the brightness bug).
  • Loading branch information
crydalch committed Jun 27, 2023
1 parent 59a4090 commit 7dc309a
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 144 deletions.
8 changes: 7 additions & 1 deletion libraries/stdlib/stdlib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
Node: <triplanarprojection> Supplemental Node
Samples data from three images, or layers within multi-layer images, and projects a tiled
representation of the images along each of the three respective coordinate axes, computing
a weighted blend of the three samples using the geometric normal.
an adjustable weighted blend of the three samples using the geometric normal.
-->
<nodedef name="ND_triplanarprojection_float" node="triplanarprojection" nodegroup="texture3d">
<input name="filex" type="filename" value="" uniform="true" />
Expand All @@ -307,6 +307,7 @@
<input name="default" type="float" value="0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand All @@ -323,6 +324,7 @@
<input name="default" type="color3" value="0.0, 0.0, 0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand All @@ -339,6 +341,7 @@
<input name="default" type="color4" value="0.0, 0.0, 0.0, 0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand All @@ -355,6 +358,7 @@
<input name="default" type="vector2" value="0.0, 0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand All @@ -371,6 +375,7 @@
<input name="default" type="vector3" value="0.0, 0.0, 0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand All @@ -387,6 +392,7 @@
<input name="default" type="vector4" value="0.0, 0.0, 0.0, 0.0" />
<input name="position" type="vector3" defaultgeomprop="Pobject" />
<input name="normal" type="vector3" defaultgeomprop="Nobject" />
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" />
<input name="framerange" type="string" value="" uniform="true" />
<input name="frameoffset" type="integer" value="0" uniform="true" />
Expand Down
Loading

0 comments on commit 7dc309a

Please sign in to comment.