Build Optimizations
intermediate performanceVolumetric Lights 2 (URP) · Troubleshooting & FAQ
Build Optimizations
Volumetric Lights uses shader keywords to toggle features. Each keyword multiplies the number of shader variants, which increases initial build time. Once compiled, Unity caches the results so subsequent builds are fast.
Stripping Unused Keywords
Edit VolumetricLights/Resources/Shaders/VolumetricLightURP.shader and comment out or remove keywords for features you do not use:
// Feature keywords (remove if not used)
#pragma multi_compile _ VF2_DEPTH_PREPASS // Depth pre-pass Render Feature
#pragma multi_compile_local _ VL_NOISE // Noise option
#pragma multi_compile_local _ VL_BLUENOISE // Blue Noise option
#pragma multi_compile_local _ VL_DIFFUSION // Diffusion Intensity
#pragma multi_compile_local _ VL_PHYSICAL_ATTEN // Quadratic attenuation
#pragma shader_feature_local VL_CUSTOM_BOUNDS // Custom Bounds option
Light Type Keywords
Remove keywords for light types you do not use:
#pragma multi_compile_local VL_SPOT VL_SPOT_COOKIE VL_POINT VL_AREA_RECT VL_AREA_DISC
Shadow Keywords
If you do not use shadows at all, remove this line. If you use shadows but not cubemap-based point light shadows, remove only VL_SHADOWS_CUBEMAP:
#pragma multi_compile_local _ VL_SHADOWS VL_SHADOWS_CUBEMAP
Important: Upgrading Volumetric Lights will overwrite the shader file and restore all keywords. Re-apply your customizations after each update.
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.