Unity Products:Amplify Shader Editor/Float

From Amplify Creations Wiki
Jump to: navigation, search

Back to Node List

Float Node

The Float node ( shortcut: numeric 1 key ) generates a single float 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.
This node can also be set as a ranged float by defining different values to its Min and Max parameters. As a ranged float it will only have values between [Min,Max].
A slider for current Value and Min and Max value modifiers will be made available on the node body when on ranged float mode.

Nodes used: Texture Coordinates, Float, Multiply, Texture Sample

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.
Name Name of the property holding the float 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 Float #
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
  • Fixed: Lowest precision, useful only for values in the range of [-2, 2] (ie: unit vectors, colors, etc)
Min Defines minimum value if node is set to be a ranged float 0
Max Defines maximum value if node is set to be a ranged float 0
Default Value This is the float value the shader currently holds. It's also the default value that is used when a new material is created with this shader. 0
Other Parameters
Property Name This is the variable name that contains the float 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. _Float#
Material Value This is the float 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

Math Operators - Floats and Color

Back to Node List