Property Types
Description
Property Types are the types of Property than can be defined on the Blackboard for use in the Graph. These Properties are exposed to the Inspector for Materials that use the shader.
Each property has an associated Data Type. See Data Types for more information.
Common Parameters
All properties have the following common parameters in addition to those specific to their Data Types.
Parameter | Description |
---|---|
Name | The display name of the property. |
Reference | The internal name for the property in the shader. If you overwrite this parameter, be aware of the following:
|
Show In Inspector | Displays the property in the material inspector. If you disable this option, it includes an [HideInInspector] attribute to the material property (refer to Properties block reference in ShaderLab for more details). |
Read Only | Adds a PerRendererData attribute to the material property to display the value as read-only in the material inspector. |
Custom Attributes | A list of entries that allow you to call custom functions you scripted to create additional material property drawers, like static decorators or complex controls. The Custom Material Property Drawers sample, available in the Package Manager among other Shader Graph samples, shows how to display a Vector2 as a min/max slider, for example. Note: When you declare the custom functions in the script, make sure to suffix their names with Drawer or Decorator .In the list, use + or - to add or remove entries. Each entry corresponds to a function call which requires the following parameters:
|
Float
Defines a Float value.
Parameters specific to Float properties in addition to the common parameters:
Parameter | Description |
---|---|
Mode | Select the UI mode in which you want to display the Property and manipulate its value in the material inspector. You need to define a specific subset of parameters according to the option you select. The options are:
|
Default Value | The default value of the Property. The value might be either a float or an integer according to the Mode and options you select. |
Slider
Additional parameters available when you set the Float property Mode to Slider.
Parameter | Description |
---|---|
Slider Type | Select the slider response type to apply when you move the slider to change the value in the material inspector. The options are:
|
Min | The minimum value of the slider range. |
Max | The maximum value of the slider range. |
Power | The exponent to use for non-linear response between Min and Max when you set the Slider Type to Power. |
Enum
Additional parameters available when you set the Float property Mode to Enum.
Parameter | Description |
---|---|
Enum Type | Select the source type to use for the dropdown entries in the material inspector. The options are:
|
Entries | The list of dropdown entries to define when you set Enum Type to Explicit Values. Use + or - to add or remove entries. You have to define each entry with the following parameters:
|
C# Enum Type | The existing Enum Type reference to use when you set Enum Type to Type Reference. Specify the full path of the type with the namespace. For example, to get Unity's predefined blend mode values: UnityEngine.Rendering.BlendMode . |
Vector 2
Defines a Vector 2 value. Displays a Vector 4 input field in the material inspector, where the z and w components are not used.
Data Type | Modes |
---|---|
Vector 2 |
Field | Type | Description |
---|---|---|
Default | Vector 2 | The default value of the Property. |
Vector 3
Defines a Vector 3 value. Displays a Vector 4 input field in the material inspector, where the w component is not used.
Data Type | Modes |
---|---|
Vector 3 |
Field | Type | Description |
---|---|---|
Default | Vector 3 | The default value of the Property. |
Vector 4
Defines a Vector 4 value. Displays a Vector 4 input field in the material inspector.
Data Type | Modes |
---|---|
Vector 4 |
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
Color
Defines a Color value. If the Property Inspector displays Main Color, this is the Main Color for the shader. To select or deselect this node as the Main Color, right-click it in the graph or Blackboard and select Set as Main Color or Clear Main Color. Corresponds to the MainColor
ShaderLab Properties attribute.
Data Type | Modes |
---|---|
Color | Default, HDR |
Default
Displays an sRGB color field in the material inspector.
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
HDR
Displays an HDR color field in the material inspector.
Field | Type | Description |
---|---|---|
Default | Vector 4 | The default value of the Property. |
NOTE: In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the Graph Inspector to upgrade them. To mimic the old behavior in a gamma space project, you can use the Colorspace Conversion Node to convert a new HDR Color property from RGB to Linear space.
Texture 2D
Defines a Texture 2D value. Displays an object field of type Texture in the material inspector. If the Property Inspector displays Main Texture, this is the Main Texture
for the shader. To select or deselect this node as the Main Texture
, right-click on it in the graph or Blackboard and select Set as Main Texture or Clear Main Texture. Corresponds to the MainTexture
ShaderLab Properties attribute.
Data Type | Modes |
---|---|
Texture | White, Black, Grey, Bump |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Use Tiling and Offset | Boolean | When set to false, activates the property NoScaleOffset, to enable manipulation of scale and offset separately from other texture properties. See SplitTextureTransformNode. |
Texture 3D
Defines a Texture 3D value. Displays an object field of type Texture 3D in the material inspector.
Data Type | Modes |
---|---|
Texture |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Texture 2D Array
Defines a Texture 2D Array value. Displays an object field of type Texture 2D Array in the material inspector.
Data Type | Modes |
---|---|
Texture |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Cubemap
Defines a Cubemap value. Displays an object field of type Texture in the material inspector.
Data Type | Modes |
---|---|
Cubemap |
Field | Type | Description |
---|---|---|
Default | Cubemap | The default value of the Property. |
Virtual Texture
Defines a Texture Stack, which appears as object fields of type Texture in the Material Inspector. The number of fields correspond to the number of layers in the property.
Data Type | Modes |
---|---|
Virtual Texture |
Field | Type | Description |
---|---|---|
Default | Texture | The default value of the Property. |
Boolean
Defines a Boolean value. Displays a ToggleUI field in the material inspector. Note that internally to the shader this value is a Float. The Boolean type in Shader Graph is merely for usability.
Data Type | Modes |
---|---|
Boolean |
Field | Type | Description |
---|---|---|
Default | Boolean | The default value of the Property. |