Boat Attack使用了Universal RP的许多新图形功能,可以用于探索 Universal RP 的使用方式和技巧。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

1.3 KiB

Shader Stripping

Unity compiles many Shader Variants from a single Shader source file. The number of Shader Variants depends on how many keywords you’ve included in the Shader. In the default Shaders, the Universal Render Pipeline (UniversalRP) uses a set of keywords for lighting and shadows. UniversalRP can exclude some Shader variants, depending on which features are active in the UniversalRP Asset.

When you disable certain features in the UniversalRP Asset, the pipeline “strips” the related Shader variants from the build. Stripping your Shaders gives you smaller build sizes and shorter build times. This is useful if your project is never going to use certain features or keywords.

For example, you might have a project where you never use shadows for directional lights. Without Shader stripping, Shader variants with directional shadow support remain in the build. If you know you won't use these shadows at all, you can uncheck Cast Shadows in the UniversalRP Asset for main or additional direction lights. UniversalRP then strips these Shader Variants from the build.

For more information about stripping Shader Variants in Unity, see this blog post by Christophe Riccio.