Unity Products:Amplify Shader Editor/Matrix3X3: Difference between revisions

From Amplify Creations Wiki
Jump to navigation Jump to search
ampwiki>Amplify RnD Rick
No edit summary
 
m (1 revision imported)
 
(No difference)

Latest revision as of 00:06, 2 December 2023

Back to Node List

Matrix3X3 Node

The Matrix3x3 node generates a 3x3 Matrix variable containing a total of 9 float components. Matrix variables cannot be set as shader properties so, unlike other property nodes like Float or Vector4, their Type can only be set as Constant or Global. These type of data structures are commonly used on different situations like transforming data between different coordinate spaces, per example transforming a position from local to world space, rotating vector position or directions among others.


NOTE: Most of the more commonly used transform matrices already have specific nodes like p.e. Object To World or World To Object.


Node Parameter Description Default Value
Type A set of ways the value behaves in different situations.
  • Constant: the value is assigned directly in shader code and can't be dynamically changed.
  • Global: the value can only be set by script and this defines a static variable that is shared between all shaders that use it. It's useful to change a value globally.
  • Instanced: the value can only be set by script and this defines the shader as an instanced shader. ( see more here: GPU Instancing )
  • CBuffer: the variable is set inside UnityPerMaterial constant buffer. Only available over SRP(HDRP/URP) shader types.
Constant
Name Name to used on generating the shader Global Variable name if its type is set to Global. Otherwise it is ignored but still useful for organization purposes Matrix #
Variable Mode Defines if the current global variable is to be created on the current shader.
  • Create: Global variable is created in the shader
  • Fetch: Does not register variable, useful when p.e. there's need to using global variables declared over a included cginc
Create
Auto-Register If toggled on, creates the global variable even if not connected to an Output node Off
Precision Defines the amount of bytes the variable can hold, effectively defining how precise the value is. It's usefulness is bond by the hardware specifications necessary. Lowest precision is slightly faster but might produce errors and artifacts.
  • Float: Highest precision, useful for values that can be very high or very low in value (ie: positions, coordinates, etc)
  • Half: Medium precision, in most cases is as good as Float but at half of it's precision
Float
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. 0


Back to Node List