Version: Unity 6.2 Alpha (6000.2)
Language : English
Assign a shader to a material in URP
Introduction to reducing shader variants in URP

Reducing shader variants in URP

Resources on speeding up builds by reducing the number of shadersA program that runs on the GPU. More info
See in Glossary
URP compiles.

Page Description
Introduction to reducing shader variants Learn about disabling features and shader keywords to speed up builds, and reduce memory usage and file sizes.
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.
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.
Strip fog shader variants Make Unity use dynamic branching in the shader code that generates fog, instead of keywords and shader variants.
Remove shader variants if you use a custom Renderer Feature Use the FilterAttribute API to remove shader variants.

Additional resources

Assign a shader to a material in URP
Introduction to reducing shader variants in URP
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961