Unity Products:Amplify Shader Editor/Toggle Switch
Jump to navigation
Jump to search
Toggle Switch Node
The Toggle Switch outputs one of its inputs according to the current toggle value set on its internal property. This value can later be changed in build time via its assigned material.
Nodes used:
Color,
Toggle Switch
Node Parameter | Description | Default Value |
---|---|---|
Name | Name of the property holding to be used as selector on the toggle switch operation | Toggle Switch# |
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 |
Generate Keyword | By default Unity's material drawer used to show the toggle UI also internally generates a global shader keyword. Toggling this option off prevents this keyword from being generated. | On |
Default Toggle Value | This is the toggle value the shader currently holds. It's also the default value that is used when a new material is created with this shader. | In 0 |
Other Parameters | ||
Property Name | This is the variable name that contains the toggle 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 Toggle Name" becomes "_MyToggleName" ). | _ToggleSwitch# |
Material Toggle Value | This is the toggle value the node the material currently holds. | In 0 |
In 0 | Value to be set on the output if 0 is set as toggle value. Only visible if the respective input port is not connected. | 0 |
In 1 | Value to be set on the output if 1 is set as toggle value. Only visible if the respective input port is not connected. | 0 |
Custom Attributes | ||
Attribute # | Additional attributes can be added to the generated property created by this node. |
Input Port | Description | Type |
---|---|---|
In 0 | Value to be set on the output if 0 is set as toggle value. | Float [1] |
In 1 | Value to be set on the output if 1 is set as toggle value. | Float [1] |