Unity Products:Amplify Shader Editor/If Community and Unity Products:Amplify Shader Editor/Matrix4X4: Difference between pages
(Difference between pages)
AmplifyWiki (talk | contribs) m (1 revision imported) |
ampwiki>Amplify RnD Rick No edit summary |
||
Line 1: | Line 1: | ||
== Matrix4X4 Node == | |||
The Matrix4x4 node generates a 4x4 Matrix variable containing a total of 16 float components. Matrix variables cannot be set as shader properties so, unlike other property nodes like [[Unity_Products:Amplify_Shader_Editor/Float|Float]] or [[Unity_Products:Amplify_Shader_Editor/Vector4|Vector4]], their [[#paramtype|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. | |||
<br/>'''NOTE:''' Most of the more commonly used transform matrices already have specific nodes like p.e. [[Unity_Products:Amplify_Shader_Editor/Object_To_World|Object To World ]] or [[Unity_Products:Amplify_Shader_Editor/World_To_Object|World To Object]]. | |||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
|- | |- | ||
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value | ! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value | ||
|- | |||
| id="paramtype" | 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: [https://docs.unity3d.com/Manual/GPUInstancing.html GPU Instancing] ) | |||
* '''CBuffer:''' the variable is set inside '''UnityPerMaterial''' constant buffer. Only available over SRP(HDRP/URP) shader types. | |||
| Constant | |||
|- | |||
| id="paramname" | Name | |||
| Name to used on generating the shader [[#parampname|Global Variable]] name if its type is set to [[#paramtype|Global]]. Otherwise it is ignored but still useful for organization purposes | |||
| Matrix # | |||
|- | |||
|- style="background: #e5e5e5;" | | |- style="background: #e5e5e5;" | | ||
| id=" | | id="paramVariable Mode" | 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 | |||
|- | |||
|- style="background: #e5e5e5;" | | |- style="background: #e5e5e5;" | | ||
| id=" | | id="paramAutoRegister Mode" | Auto-Register | ||
| | | If toggled on, creates the property and/or global variable even if not connected to an Output node | ||
| | | Off | ||
|- | |- | ||
|- style="background: #e5e5e5;" | | |- style="background: #e5e5e5;" | | ||
|id=" | | id="paramprecision" | 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 | | 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 | |||
| | |||
| | |||
| | |||
|} | |} | ||
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | [[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | ||
[[Category:Nodes]][[Category: | [[Category:Nodes]][[Category:Constants And Properties]] |
Revision as of 16:41, 23 August 2021
Matrix4X4 Node
The Matrix4x4 node generates a 4x4 Matrix variable containing a total of 16 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 |
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 |
Auto-Register | If toggled on, creates the property and/or 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 |
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 |