Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Recommended Graphics settings to optimize your Web build

Change the Graphics settings to create an optimized Web build.
Read time 3 minutesLast updated 18 days ago

Use the following recommended Graphics settings to optimize your builds for the Unity Web platform.

Graphics settings

Unused shaders can increase build times, file size, and memory usage. In most projects, use the Recommended option for most projects for each setting to strip your build of unused shaders and resources.
To reduce your build size further, use the Recommended option for the smallest build. Use these settings only if your project doesn't use the related feature, because they strip the shader variants and resources that the feature needs.
Find these settings under Edit >
Project Settings

?

> Graphics. For more information on each setting, refer to the details in Graphics.

Setting

Recommended option for most projects

Recommended option for the smallest build

Lightmap ModesAutomaticCustom, then deselect all the checkboxes
Fog ModesAutomaticCustom, then deselect all the checkboxes
Instancing VariantsStrip UnusedStrip All
Batch Renderer Group VariantsStrip if Entities Graphics Package is not installedStrip All
VideoInclude if referencedDon't Include
Always Included ShadersRemove unused shaders. You can also edit this list using C#.Empty the list
For more ways to reduce build size, such as removing unused packages and built-in modules, refer to Remove unused resources from your Web build.

Edit the Always Included Shaders list via C#

To change the Always Included Shaders list with a script, create a list of shaders you want in the list and assign it like this:
GraphicsSettings.alwaysIncludedShaders = newShadersList.ToArray();

URP-specific settings

If your project uses the Universal Render Pipeline (URP), use the following recommended settings to reduce the size of your Web build. Find these settings in the Graphics settings, URP assets, and Universal Renderer assets.
URP includes resources in your build based on the features you enable. Disable or strip a feature only if your project doesn't use it, otherwise your build might not have the resources it needs. Check the settings in every URP asset your build uses, and in every Universal Renderer asset that those URP assets reference.

Graphics settings for URP

In Edit > Project Settings > Graphics, configure the following settings.

Setting

Recommended option

Additional Shader Stripping Settings > Strip Runtime Debug ShadersEnabled
Additional Shader Stripping Settings > Strip Unused Post Processing Variants And ResourcesEnabled
Additional Shader Stripping Settings > Strip Unused VariantsEnabled
Additional Shader Stripping Settings > Strip Screen Coord Override VariantsEnabled
Terrain Shader Inclusion Settings > Include Terrain ShadersDisabled
When you strip shader variants, Unity might remove variants that your built project needs. Test your build to make sure it renders correctly. To check how many shader variants your project has, refer to Check how many shader variants you have. For more information, refer to Strip shader variants in URP.

URP asset options

In each URP asset your build uses, configure the following setting.

Setting

Recommended option

GPU Resident DrawerDisabled. For more information, refer to GPU Resident Drawer.

Universal Renderer asset options

In each Universal Renderer asset that your URP assets reference, configure the following settings.

Setting

Recommended option

Post-processingDisabled. For more information, refer to Post-processing in URP.
Renderer FeaturesKeep only the ones you use. For more information, refer to Renderer Features in URP.

Additional resources