Strip fog shader variants in URP
Writing custom shaders in URP
Remove shader variants when using a custom Renderer Feature in URP
If you create a custom Renderer Feature, you can use the FilterAttribute API to remove shaderA program that runs on the GPU. More info
See in Glossary variants when you enable or disable settings in the URP Asset.
For example, you can do the following:
- Use SerializeField to add a Boolean variable to the custom Renderer Feature and add it as a checkbox in the URP Asset InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary.
- Use ShaderKeywordFilter.RemoveIf to remove shader variants when you enable the checkbox.
Strip fog shader variants in URP
Writing custom shaders in URP