Version: Unity 6 Preview (6000.0)
Language : English
Troubleshooting shader duplication from AssetBundles
Debugging shaders

Control how much memory shaders use

In your built application, Unity stores several ‘chunks’ of compressed shaderA program that runs on the GPU. More info
See in Glossary
variant data. Each chunk contains multiple shader variants. When Unity loads a sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
at runtime, it loads all the scene’s chunks into CPU memory and decompresses them.

To reduce memory usage on platforms that have limited memory, you can limit the size of chunks and how many decompressed chunks Unity keeps in memory.

To do this, in Player settingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary
, select Other Settings > Shader Variant Loading and adjust the following settings:

  • Use Default chunk size (MB) to set the maximum size of compressed chunks Unity stores in your built application.
  • Use Default chunk count to limit how many decompressed chunks Unity keeps in memory. The default is 0, which means there’s no limit.

See PlayerSettings.SetDefaultShaderChunkCount for more information.

You can use Override to override the values for each platform individually. See PlayerSettings.SetShaderChunkCountForPlatform for more information.

You can also use Shader.maximumChunksOverride to override Default chunk count at runtime.

Troubleshooting shader duplication from AssetBundles
Debugging shaders