Version: Unity 6.3 Beta (6000.3)
Language : English
Assign a channel-packed texture to a URP material
Check how many shader variants your build has in URP

Reducing shader variants in URP

The shadersA program that runs on the GPU. More info
See in Glossary
in the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
(URP) use shader keywords to support many different features, which might mean Unity compiles a lot of shader variantsA verion of a shader program that Unity generates according to a specific combination of shader keywords and their status. A Shader object can contain multiple shader variants. More info
See in Glossary
.

The following resources are about speeding up builds by reducing the number of shader variants URP compiles.

For more information, refer to Reduce shader variants, which applies to all render pipelines.

Page Description
Check how many shader variants your build has Log how many shader variants Unity compiles and strips.
Strip feature shader variants To remove shader variants for features you don’t use, enable Strip Unused Variants in URP Graphics settings.
Enable dynamic branching in prebuilt shaders Make Unity use dynamic branching in prebuilt shaders, instead of keywords and shader variants.
Strip level of detail (LOD) shader variants To reduce shader variants by around 50%, make Unity use stencil testing instead of alpha testing to fade between different LODThe Level Of Detail (LOD) technique is an optimization that reduces the number of triangles that Unity has to render for a GameObject when its distance from the Camera increases. More info
See in Glossary
levels.
Remove shader variants if you use a custom Renderer Feature Use the FilterAttribute API to remove shader variants.

Additional resources

For more information on stripping shader variants, refer to the following pages:

Assign a channel-packed texture to a URP material
Check how many shader variants your build has in URP