# SetDefaultShaderChunkSizeInMB(int)

> Sets the default size for compressed shader variant chunks.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.3/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void SetDefaultShaderChunkSizeInMB(int sizeInMegabytes)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The chunk size in megabytes.

### Remarks

Unity stores multiple [shader variants](/engine/6000.3/manual/materials-and-shaders/shaders/shader-troubleshooting/shader-reducing/shader-variants/shader-variants.md) in compressed chunks. You can use `SetDefaultShaderChunkSizeInMB` to set the maximum size of each chunk.

You can use this parameter with [PlayerSettings.SetDefaultShaderChunkCount](/engine/6000.3/script-reference/unityeditor/playersettings/setdefaultshaderchunkcount.md) to limit the amount of memory Unity uses for shader variants.

Use [PlayerSettings.SetShaderChunkSizeInMBForPlatform](/engine/6000.3/script-reference/unityeditor/playersettings/setshaderchunksizeinmbforplatform.md) to override the default shader chunk size for a build target.

Additional Resources: [PlayerSettings.GetDefaultShaderChunkSizeInMB](/engine/6000.3/script-reference/unityeditor/playersettings/getdefaultshaderchunksizeinmb.md).
