Unity Products:Amplify Shader Editor/Texture Array

From Amplify Creations Wiki
Jump to: navigation, search

Back to Node List

Texture Array Node

The Texture Array node is a special kind of sampler that samples arrays of 2D textures. Using an array can potentially save performance when sampling multiple textures. They function similarly to Texture Sample nodes with the extra Index param to fetch the required texture from the array.

Note: We provide a free Texture Array Creator tool available within the ASE Package, it is accessible through "Window/Amplify Shader Editor/Texture Array Creator". The minimum Shader Model compilation target that supports texture arrays is 3.5. Be sure to check the official unity documentation here.


Nodes used: Int, Texture Array

Node Parameter Description Default Value
Mode Weather you want to use the texture directly or you want to reference an existing Texture Array sampler.
  • Object: Turns off referencing altogether
  • Reference: Turns on referencing.
Object
UV Set The UV channel used, also knows as UV Index in some applications. Set 2 is usually used for Lightmap UV coordinates.
  • [1,4]: Changes set to specified number from set 1 to set 4
1
Mip Mode Sets the way mips work with the sampler. Texture must have mip maps turned on.
  • Auto: Manages mip levels automatically.
  • Mip Level: Lets you specify an exact mip level to sample from.
  • Derivative: Lets you specify the X and Y derivatives to the sampler.
Auto
Normal Map If toggled on it will use the texture as a normal map by unpacking and scaling the result into a normal vector in tangent space. false
Other Parameters
Reference Points to an existing Texture Object or Texture Array node
  • None: Not referencing anything.
  • Option #: All other options are dynamically generated and point to all the available texture array nodes in the graph
None
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. Only visible if Mode is set to Object. Texture Array #
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" ). Only visible if Mode is set to Object and not editable to indicate what's the variable name to use when editing this value by script. _TextureArray#
Index The array index that selects the desired texture in the array. Only visible if the respective port is not connected. 0
Scale This scales the normal map perpendicular to the surface. Effectively decreasing or increasing how bumpy the surface looks. Only available if Normal Map is checked and only visible is the respective port is not connected. 1
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. Only visible if Mode is set to Object. None
Material Value This is the value the node the material currently holds. Only visible if Mode is set to Object and if the editor is open in material mode. None


Input Port Description Type
Tex This port accepts a Texture Object which allows the use of it's texture UV parameters in the material inspector. The referenced texture object cast mode must be locked to Texture 2D Array. Sampler2D
UV The UV coordinates to use when sampling the texture. If set overrides the texture tilling and offset parameters. Float2
Index The array index that selects the desired texture in the array. Float
Other Parameters
Level Defines the mipmap level value to use. Only available if Mip Mode is set to Mip Level. 0
Scale This scales the normal map perpendicular to the surface. Effectively decreasing or increasing how bumpy the surface looks. Only available if Normal Map is checked. 1
DDX The X derivative to use when doing sampling through derivatives. Only available if Mip Mode is set to Derivative. ( 0, 0 )
DDY The Y derivative to use when doing sampling through derivatives. Only available if Mip Mode is set to Derivative. ( 0, 0 )
Output Port Description Type
RGBA Returns the full RGBA color of the sampled texture from the array. Float4
R Returns only the R component of the color value which corresponds to the X component of a Vector4 Float
G Returns only the G component of the color value which corresponds to the Y component of a Vector4 Float
B Returns only the B component of the color value which corresponds to the Z component of a Vector4 Float
A Returns only the A component of the color value which corresponds to the W component of a Vector4 Float
if Normal Map is ON the output set changes to this
XYZ Returns the Unpacked and Scaled Normal in tangent space from the array. Float3
X Returns only the X component of the normal vector Float
Y Returns only the Y component of the normal vector Float
Z Returns only the Z component of the normal vector Float

Back to Node List