Modify surface options without changing your graph
Description
Enable Allow Material Override to modify a specific set of properties for Universal Render Pipeline Lit and Unlit Shader Graphs and for Built-In Render Pipeline Shader Graphs in the Material Inspector.
Property | URP Lit | URP Unlit | Built-In Render Pipeline |
Workflow Mode | See the URP documentation for the Lit URP Shader. | Not applicable. | Not applicable. |
Receive Shadows |
Cast Shadows | This property is only exposed if Allow Material Override is enabled for this Shader Graph. Enable this property to make it possible for a GameObject using this shader to cast shadows onto itself and other GameObjects. This corresponds to the SubShader Tag ForceNoShadowCasting. | Not applicable. |
Surface Type | See the URP documentation for the Lit and Unlit Shaders. | In the Built-In Render Pipeline, this feature has the same behavior as in URP. Consult the URP documentation. |
Render Face | In the Built-In Render Pipeline, this feature has the same behavior as in URP. Consult the URP documentation. |
Alpha Clipping | In the Built-In Render Pipeline, this feature has the same behavior as in URP. Consult the URP documentation. |
Depth Write |
This property is only exposed if Allow Material Override is enabled for this Shader Graph.
Use this property to determine whether the GPU writes pixels to the depth buffer when it uses this shader to render geometry.
Options:
- Auto (default): Unity writes pixels to the depth buffer for opaque materials, but not for transparent materials.
- Force Enabled Unity always writes pixels to the depth buffer.
- Force Disabled Unity never writes pixels to the depth buffer.
This option's functionality corresponds to the command ZWrite in ShaderLab. To override this setting in a RenderStateBlock, set the depthState.
|
Depth Test | This property is only exposed if Allow Material Override is enabled for this Shader Graph. Use this property to set the conditions under which pixels pass or fail depth testing. The GPU does not draw pixels that fail a depth test. If you choose anything other than LEqual (the default setting for this property), consider also changing the rendering order of this material. Options:
- LEqual (default): Unity draws the pixel, if its depth value is less than or equal to the value on the depth texture. Less: Unity draws pixels of the affected surface if their coordinates are less than the current depth buffer value.
- Never: Unity never draws the pixels of the affected surface.
- Less: Unity draws pixels of the affected surface if their coordinates are less than the current depth buffer value.
- Greater: Unity draws pixels of the affected surface if their coordinates are greater than the current depth buffer value.
- GEqual: Unity draws pixels of the affected surface if their coordinates are greater than or equal to the current depth buffer value.
- Equal: Unity draws pixels of the affected surface if their coordinates are equal to the current depth buffer value.
- NotEqual: Unity draws pixels of the affected surface if their coordinates are not the same as the current depth buffer value.
- Always: Unity draws this surface to your screen regardless of its z-coordinate.
This option's functionality corresponds to the command ZTest in ShaderLab. To override this setting in a RenderStateBlock, set the depthState property.
|
Support VFX Graph | This property is only available if the Visual Effect Graph package is installed. Indicates whether this Shader Graph supports the Visual Effect Graph. If you enable this property, output contexts can use this Shader Graph to render particles. The internal setup that Shader Graph does to support visual effects happens when Unity imports the Shader Graph. This means that if you enable this property, but don't use the Shader Graph in a visual effect, there is no impact on performance. It only affects the Shader Graph import time. | Not applicable. |
How to use
To use the Material Override feature:
- Create a new graph in Shader Graph.
- Save this graph.
- Open the Graph Inspector.
- Set Active Targets to Universal or Built In.
- In the Graph Inspector’s Universal or Built In section, enable Allow Material Override.
- Create or select a Material or GameObject which uses your Shader Graph.
- In the Material Inspector, modify Surface Options for the target Material or GameObject.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.