Unity Products:Amplify Shader Editor/Int

From Amplify Creations Wiki
Revision as of 16:24, 23 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

Int Node

The Int node ( shortcut: numeric 0 key ) generates a single integer value. This value is usually useful to either define a Constant value which is directly used in shader calculations or to define an exposed Property value that can be modified by the material inspector that uses it.


Nodes used: Color, Int, Lerp, Float, Subtract

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.
  • Property: the value becomes available in the properties of the material that uses the shader and can be changed in the material inspector or by script.
  • Instanced Property: the value can only be set by script and this defines the shader as an instanced shader. ( see more here: GPU Instancing )
  • 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.
Constant
Name Name of the property holding the integer value. This is the name that will be shown in the material properties label if type is set to Property, if not this name is ignored but still useful for organization purposes or to generate a Property Name Int #
Variable Mode Defines if the current property/global variable is to be created on the current shader.
  • Create: Property and/or global variable is created in the shader
  • Fetch: No variable nor property is registered on shader, useful when p.e. there's need to using global variables declared over a included cginc
Create
Auto-Register If toggled on, creates the property and/or global variable even if not connected to an Output node Off
Default Value This is the integer value the shader currently holds. It's also the default value that is used when a new material is created with this shader. 0
Set as UINT Sets variable as an unsigned int. Allows only positive integers, variable bit size is the same so it allows bigger values Off
Other Parameters
Property Name This is the variable name that contains the integer 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" ). This parameter is only visible in Property, Instanced Property and Global types to indicate what's the variable name to use when editing this value by script. _Int#
Material Value This is the integer value the node the material currently holds. This parameter is only visible in Property and Instanced Property types which are the two types that let you change the value per material. 0
Attributes
Hide in Inspector Does not show the property value in the material inspector Off
HDR Indicates that a property expects a high-dynamic range (HDR) value Off
Gamma Indicates that a property is specified as sRGB value in the UI and possibly needs conversion according to color space used Off
Per Renderer Data Indicates that a property will be coming from per-renderer data in the form of a MaterialPropertyBlock. Off
Enum Displays a popup menu for an int property, and enables corresponding shader keyword. This option activates a new Enums group where the user can either create custom enums or use engine enum classes Off
Custom Attributes Allows adding custom attributes directly on a textfield -

Back to Node List