Canvas
The Canvas Master Stack material type enables you to author Shader Graph shaders that can be applied to UGUI user interface elements.
Create a Canvas Shader Graph
To create a Canvas material in Shader Graph, use one of the following methods:
- Modify an existing Shader Graph:
- Open the Shader Graph in the Shader Editor.
- In Graph Settings, select the HDRP Target. If there isn't one, go to Active Targets > Plus, and select HDRP.
- In the Material drop-down, select Canvas.
- Create a new Shader Graph. Go to Assets > Create > Shader Graph > HDRP, and select Canvas Shader Graph.
Contexts
This Master Stack material type has its own set of Graph Settings. Because of the relationship between settings and Blocks, this has consequences on which Blocks are relevant to the Graph. This section contains information on the Blocks this Master Stack material type adds by default, and which Blocks set properties for this Master Stack material type's Graph Settings.
For more information about the relationship between Graph Settings and Blocks, see Contexts and Blocks.
Vertex Context
The Vertex context represents the vertex stage of this shader. Unity executes any block you connect to this context in the vertex function of this shader. For more information, refer to Master Stack.
Vertex blocks are not compatible with the Canvas Master Stack.
Fragment Context
The Fragment Context contains the default and relevant Blocks for the Canvas Master Stack target.
Default Fragment Context Blocks
When you create a new Canvas Master Stack, the Fragment Context contains the following Blocks by default:
Property | Description | Setting Dependency | Default Value |
---|---|---|---|
Base Color | The base color of the material. | None | Color.grey |
Alpha | The Material's alpha value. This determines how transparent the material is. The expected range is 0 - 1. | None | 1.0 |
Emission | The color of light to emit from this material's surface. Emissive materials appear as a source of light in your scene. | None | Color.black |
Relevant Fragment Context Blocks
Depending on the Graph Settings you use, Shader Graph might add the following Blocks to the Fragment Context:
Graph Settings
The following table describes the Surface options:
Property | Description | Setting Dependency | Default Value |
---|---|---|---|
Alpha Clip Threshold | The alpha value limit that HDRP uses to determine whether to render each pixel. If the alpha value of the pixel is equal to or higher than the limit, HDRP renders the pixel. If the value is lower than the limit, HDRP does not render the pixel. The default value is 0.5. | Alpha Clipping enabled | 0.5 |
Property | Description |
---|---|
Material Type | Specifies a type for the material. This allows you to customize the material with different settings depending on the type you select. The options are: • Subsurface Scattering: Applies the subsurface scattering workflow to the material. Subsurface scattering simulates the way light interacts with and penetrates translucent objects, such as skin or plant leaves. When light penetrates the surface of a subsurface scattering material, it scatters and blurs before exiting the surface at a different point. • Standard: Applies the basic metallic Shader workflow to the material. This is the default Material Type. • Anisotropy: Applies the anisotropic workflow to the material. The highlights of Anisotropic surfaces change in appearance as you view the material from different angles. Use this Material Type to create materials with anisotropic highlights. For example, brushed metal or velvet. • Iridescence: Applies the Iridescence workflow to the material. Iridescent surfaces appear to gradually change color as the angle of view or angle of illumination changes. Use this Material Type to create materials like soap bubbles, iridescent metal, or insect wings. • Specular Color: Applies the Specular Color workflow to the material. Use this Material Type to create Materials with a coloured specular highlight. This is similar to the built-in Specular Shader. • Translucent: Applies the Translucent workflow to the material. Use this Material Type, and a thickness map, to simulate a translucent material. In contrast to Subsurface Scattering materials, Translucent materials do not blur light that transmits through the material. For more information about the feature and for the list of properties each Material Type exposes, see the Material Type documentation. |
Alpha Clipping |
Indicates whether this material acts like a Cutout Shader. For more information about the feature and for the list of properties this feature exposes, see the Alpha Clipping documentation. |