Unity Products:Amplify Shader Editor/Triplanar Sample

From Amplify Creations Wiki
Revision as of 10:44, 26 August 2021 by ampwiki>Amplify RnD Rick
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to Node List

Triplanar Sample Node

The Triplanar Sample node is a special node that textures a model using a "Triplanar Mapping" technique. You can think of triplanar mapping as a technique that projects textures to a model using 3 projection planes, one for each XYZ axis. By setting the Normal Map option ON the node is also capable of dealing with normal correction in case you want to use normalmaps. This node is just a convenience node for a general purpose triplanar effect, it's not suppose to replace all kinds of triplanar effects, just the more common ones.


Nodes used: Float, Triplanar Sample

Node Parameter Description Default Value
Name The name of the node, not really useful to anything besides organization. Triplanar Sample
Mapping The type of projection it does which is bound by the planes it projects from.
  • Spherical: It projects 1 texture from all 3 planes in both positive and negative axis, effectively wrapping the object with 1 texture.
  • Cylindrical: It projects 3 textures, 1 texture from the vertical top pointing down, 1 texture from all around horizontal XY axis and 1 texture from the vertical bottom pointing up, effectively wrapping as a cylinder.
Spherical
Space The space UV coordinate system it projects from.
  • Object: Projects from local/object space which means the texture is bound to the object surface. Useful for dynamic objects.
  • World: Projects from world space which means the texture "swims" on top of the object surface. Useful for static objects and to create continuity of texture between different objects.
World
Normal Map By setting this option ON a normal tangent correction will be applied to normal maps so that tangent space vectors from normal maps align correctly onto the object surface, otherwise normal maps will look inverted in some projection planes. false
Other Parameters
Tilling A multiplier that controls the scale repetition of the textures being projected onto the surface. Only visible is equivalent input port is not connected. 1
Falloff A multiplier that controls the interpolated blend between the projected planes. Higher values means harder blends while lower means softer. Only visible is equivalent input port is not connected. 1
Top Texture
Name Name of the property holding the value. This is the name that will be shown in the material properties label, useful for organization purposes or to generate a Property Name. Top Texture #
Property Name This is the variable name that contains the value, this is automatically generated using the Name parameter, it's greyed out and not editable. The generation process removes special characters, whitespaces and adds an underscore at the beginning ( ie: "My Property Name" becomes "_MyPropertyName" ). _TopTexture#
Default Texture This is a fallback texture value that will be used if the default value is not set.
  • White: Uses Unity's built-in white texture. RGBA( 1, 1, 1, 1).
  • Black: Uses Unity's built-in black texture. RGBA( 0, 0, 0, 0).
  • Gray: Uses Unity's built-in gray texture. RGBA( 0.5, 0.5, 0.5, 0.5).
  • Bump: Uses Unity's built-in bump texture. RGBA( 0.5, 0.5, 1, 0.5).
White
Default Value This is the value the shader currently holds. It's also the default value that is used when a new material is created with this shader. None
Material Value This is the value the node the material currently holds. Only visible if the editor is open in material mode. None
Middle Texture, only visible if Mapping is set to Cylindrical
Name Name of the property holding the value. This is the name that will be shown in the material properties label, useful for organization purposes or to generate a Property Name. Mid Texture #
Property Name This is the variable name that contains the value, this is automatically generated using the Name parameter, it's greyed out and not editable. The generation process removes special characters, whitespaces and adds an underscore at the beginning ( ie: "My Property Name" becomes "_MyPropertyName" ). _MidTexture#
Default Texture This is a fallback texture value that will be used if the default value is not set.
  • White: Uses Unity's built-in white texture. RGBA( 1, 1, 1, 1).
  • Black: Uses Unity's built-in black texture. RGBA( 0, 0, 0, 0).
  • Gray: Uses Unity's built-in gray texture. RGBA( 0.5, 0.5, 0.5, 0.5).
  • Bump: Uses Unity's built-in bump texture. RGBA( 0.5, 0.5, 1, 0.5).
White
Default Value This is the value the shader currently holds. It's also the default value that is used when a new material is created with this shader. None
Material Value This is the value the node the material currently holds.Only visible if the editor is open in material mode. None
Bottom Texture, only visible if Mapping is set to Cylindrical
Name Name of the property holding the value. This is the name that will be shown in the material properties label, useful for organization purposes or to generate a Property Name. Bot Texture #
Property Name This is the variable name that contains the value, this is automatically generated using the Name parameter, it's greyed out and not editable. The generation process removes special characters, whitespaces and adds an underscore at the beginning ( ie: "My Property Name" becomes "_MyPropertyName" ). _BotTexture#
Default Texture This is a fallback texture value that will be used if the default value is not set.
  • White: Uses Unity's built-in white texture. RGBA( 1, 1, 1, 1).
  • Black: Uses Unity's built-in black texture. RGBA( 0, 0, 0, 0).
  • Gray: Uses Unity's built-in gray texture. RGBA( 0.5, 0.5, 0.5, 0.5).
  • Bump: Uses Unity's built-in bump texture. RGBA( 0.5, 0.5, 1, 0.5).
White
Default Value This is the value the shader currently holds. It's also the default value that is used when a new material is created with this shader. None
Material Value This is the value the node the material currently holds.Only visible if the editor is open in material mode. None


Input Port Description Type
Tex/Top This port accepts a Texture Object which allows the use of it's texture UV parameters in the material inspector. When Mapping is set to Spherical it uses this port or the corresponding picker to represent the texture for that mapping type. When set to Cylindrical it only represents the top texture. The label of this port changes accordingly. Sampler2D
World Pos / Local Pos If set, uses the connected world/local position (depending the selected Space) instead of the current world/local position. Useful when applying a vertex offset to the shader. Float3
Tilling A multiplier that controls the scale repetition of the textures being projected onto the surface. Float2
Falloff A multiplier that controls the interpolated blend between the projected planes. Higher values means harder blends while lower means softer. Float
Other Parameters
Middle This port accepts a Texture Object which allows the use of it's texture UV parameters in the material inspector. This is only visible when Mapping is set to Cylindrical and represents it's middle texture. Sampler2D
Bottom This port accepts a Texture Object which allows the use of it's texture UV parameters in the material inspector. This is only visible when Mapping is set to Cylindrical and represents it's bottom texture. Sampler2D
Output Port Description Type
RGBA Returns the full RGBA color of the triplanar effect. Float4
R Returns only the R component of the color value which corresponds to the X component of the triplanar effect. Float
G Returns only the G component of the color value which corresponds to the Y component of the triplanar effect. Float
B Returns only the B component of the color value which corresponds to the Z component of the triplanar effect. Float
A Returns only the A component of the color value which corresponds to the W component of the triplanar effect. Float
if Normal Map is ON the output set changes to this
XYZ Returns the tangent space corrected normals of the triplanar effect. Float3
X Returns only the X component of the corrected normals. Float
Y Returns only the Y component of the corrected normals. Float
Z Returns only the Z component of the corrected normals. Float

Back to Node List