기술 자료

Unity Engine


User Manual

Script Reference

Unity Engine


Settings and keywords reference for stripping keywords in URP

Explore the settings and shader keywords you can use to strip shader variants.
읽는 시간 6분최근 업데이트: 한 달 전

Explore the settings and shader keywords you can use to speed up build time in the Universal Render Pipeline (URP) by stripping shader variants. For more information, refer to Strip shader variants.
중요
When you remove built-in shader keywords, Unity might strip shader variants your built project needs. To check how many shader variants your project has, enable strict shader variant matching, otherwise Unity might replace missing shader variants with others. For more information, refer to Check how many shader variants you have.

Decals

Feature

Location in the Editor

Keyword set for Shader Build Settings

Decals that use DBuffer modeUniversal Renderer. In the Decals Renderer Feature, set Technique to Screen Space.
_ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
Decals that use Screen Space modeUniversal Renderer. In the Decals Renderer Feature, set Technique to DBuffer.
_DECAL_NORMAL_BLEND_LOW
_DECAL_NORMAL_BLEND_MEDIUM
_DECAL_NORMAL_BLEND_HIGH
Rendering layers for decalsUniversal Renderer. In the Decals Renderer Feature, disable Use Rendering Layers.
_ _DECAL_LAYERS

Fog

Feature

Location in the Editor

Keyword set for Shader Build Settings

FogLighting window. In the Other Settings section, disable Fog.
_ _FOG_LINEAR FOG_EXP FOG_EXP2
To keep fog but reduce shader variants by using dynamic branching, refer to Enable dynamic branching in prebuilt shaders.

Level of detail (LOD)

Feature

Location in the Editor

Keyword set for Shader Build Settings

LOD transitionsURP asset. In the Quality section, disable LOD Cross Fade.
_ LOD_FADE_CROSSFADE
For other ways to reduce LOD shader variants, refer to Strip LOD shader variants.

Lighting

Feature

Location in the Editor

Keyword set for Shader Build Settings

Additional lights (Forward rendering paths only)URP asset. In the Lighting section, set Additional Lights to Disabled.
_ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
Light cookiesLight components. In the Emission section, remove cookie textures from all lights in your project.
_ _LIGHT_COOKIES
Rendering layers for lightsURP asset. For more information, refer to Rendering Layers.
_ _LIGHT_LAYERS

Lightmapping

Feature

Location in the Editor

Keyword set for Shader Build Settings

LightmapsLightmapping settings. Disable Realtime Global Illumination and Baked Global Illumination.
_ LIGHTMAP_ON
Directional lightmapsLightmapping settings. Set Directional Mode to Non-Directional.
_ DIRLIGHTMAP_COMBINED
Bicubic sampling of lightmapsGraphics settings. In the Lighting section, disable Use Bicubic Lightmap Sampling.
_ LIGHTMAP_BICUBIC_SAMPLING

Materials

Feature

Location in the Editor

Keyword set for Shader Build Settings

Alpha clippingMaterial properties. In the Surface Options section, disable Alpha Clipping.
_ _ALPHATEST_ON
Clear coatMaterial properties. In the Detail Inputs section, disable Clear coat for all Complex Lit materials.
_ _CLEARCOAT _CLEARCOATMAP
Detail mappingMaterial properties. In the Detail Inputs section, remove the textures for all materials.
_ _DETAIL_MULX2 _DETAIL_SCALED
EmissionMaterial properties. In the Detail Inputs section, disable Emission for all materials.
_ _EMISSION
Environment reflectionsMaterial properties. In the Advanced Options section, disable Environment Reflections.
_ _ENVIRONMENTREFLECTIONS_OFF
. Removing this keyword enables environment reflections.
Height mapsMaterial properties. In the Surface Inputs section, remove the Height Map texture for all materials.
_ _PARALLAXMAP
Metallic or specular mapsMaterial properties. In the Surface Inputs section, remove the Metallic Map or Specular Map texture for all materials.
_ _METALLICSPECGLOSSMAP
Normal mapsMaterial properties. In the Surface Inputs section, remove the Normal Map texture for all materials.
_ _NORMALMAP
Occlusion mapsMaterial properties. In the Surface Inputs section, remove the Occlusion Map texture for all materials.
_ _OCCLUSIONMAP
ShadowsMaterial properties. In the Surface Options section, disable Receive shadows.
_ _RECEIVE_SHADOWS_OFF
. Set Override type to
shader_feature
or
multi_compile
. Removing this keyword enables GameObjects receiving shadows.
Smoothness from Base Map alphaMaterial properties. In the Surface Inputs section, under Metallic Map or Specular Map, set Source to Metallic Alpha or Specular Alpha.
_ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
Specular highlightsMaterial properties. In the Advanced Options section, disable Specular Highlights.
_ _SPECULARHIGHLIGHTS_OFF
. Removing this keyword enables specular highlights.
Specular highlights on transparent materialsMaterial properties. In the Surface Options section on all transparent materials, disable Preserve Specular Lighting and set Blending Mode to either Alpha, Premultiply, or Additive.
_ _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
Specular setupMaterial properties. In the Surface Options section, set Workflow mode to Metallic for all materials.
_ _SPECULAR_SETUP
TransparencyIn the Surface Options section of the Material properties, set Surface Type to Opaque for all materials.
_SURFACE_TYPE_TRANSPARENT
Terrain holesURP asset. In the Rendering section. Disable Terrain Holes.N/A

Post-processing

Feature

Location in the Editor

Keyword set for Shader Build Settings

BloomVolume Overrides. Remove the Bloom Volume Override.
_ _BLOOM_LQ _BLOOM_HQ _BLOOM_LQ_DIRT _BLOOM_HQ_DIRT
Chromatic AberrationVolume Overrides. Remove the Chromatic Aberration Volume Override.
_ _CHROMATIC_ABERRATION
Depth of Field - high quality samplingVolume Overrides. In the Depth of Field Volume Override, disable High Quality Sampling.
_ _HIGH_QUALITY_SAMPLING
DitheringCamera properties. In the Rendering section, disable Dithering.
_ _DITHERING
Film GrainVolume Overrides. Remove the Film Grain Volume Override.
_ _FILM_GRAIN
Lens DistortionVolume Overrides. Remove the Lens Distortion Volume Override.
_ _DISTORTION
Screen Space Ambient Occlusion (SSAO)Universal Renderer. Remove the Screen Space Ambient Occlusion Renderer Feature.
_ _SCREEN_SPACE_OCCLUSION
TonemappingVolume Overrides. Remove Tonemapping Volume Override.
_ _HDR_GRADING _TONEMAP_ACES _TONEMAP_NEUTRAL
Alpha processingURP asset. In the Post-processing section, disable Alpha Output.
_ _ENABLE_ALPHA_OUTPUT

Rendering paths

Feature

Location in the Editor

Keyword set for Shader Build Settings

Accurate G-buffer normals (Deferred rendering paths only)Universal Renderer. In the Rendering section, disable Accurate G-buffer normals. This has no effect on platforms that use the Vulkan graphics API.
_ _GBUFFER_NORMALS_OCT
Fast sRGB to linear conversionURP asset. In the Post-processing section, disable Fast sRGB/Linear conversions.
_ _USE_FAST_SRGB_LINEAR_CONVERSION
Forward+ rendering pathUniversal Renderer. In the Rendering section, set Rendering Path to Forward+ or Deferred+.
_ _CLUSTER_LIGHT_LOOP

Reflections

Feature

Location in the Editor

Keyword set for Shader Build Settings

Reflection Probe blendingReflection Probe properties. Disable Probe Blending for all Reflection Probes.
_ _REFLECTION_PROBE_BLENDING
Reflection Probe box projectionReflection Probe properties. Disable Box Projection for all Reflection Probes.
_ _REFLECTION_PROBE_BOX_PROJECTION
Reflection Probe rotationGraphics settings. In the Lighting section, disable Use Reflection Probe Rotation.
_ REFLECTION_PROBE_ROTATION

Shadows

Feature

Location in the Editor

Keyword set for Shader Build Settings

Main lights cast shadowsURP asset. In the Lighting section, under Main Light, disable Cast Shadows.
_ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
Additional lights cast shadowsURP asset. In the Lighting section, under Additional Lights, disable Cast Shadows.
_ _ADDITIONAL_LIGHT_SHADOWS
Point Lights cast shadowsLight components. In the Shadows section, set Shadow Type to No Shadows for all Point Lights.
_ _CASTING_PUNCTUAL_LIGHT_SHADOW
Soft shadowsURP asset. In the Shadows section, disable Soft Shadows.
_ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
Shadows from the Subtractive Lighting ModeURP asset. In the Lighting section, disable Mixed Lighting.
_ LIGHTMAP_SHADOW_MIXING
Shadows from the Shadowmask Lighting ModeLightmapping settings. Set Lighting Mode to Baked Indirect or Subtractive.
_ SHADOWS_SHADOWMASK

Additional resources