Version: 2020.3
프레임 디버거
스트리밍 컨트롤러

Mip Map Streaming

The Mip Map Streaming system gives you control over which mipmap levels Unity loads into memory. This system reduces the total amount of memory Unity needs for Textures, because it only loads the mipmaps Unity needs to render the current Camera position in a Scene, instead of loading all of them by default. It trades a small amount of CPU resources to save a potentially large amount of GPU memory.

You can also use the Memory Budget to set a total memory limit for all Textures to use in a Project. The Mip Map Streaming system automatically reduces mip map levels to stay within this budget.

You can use the Mip Map Streaming API to request specific mip map levels for specific Textures. Unity provides sample C# code that duplicates the engine logic for mip map selection, which you can use to override the engine logic for your own Projects. For more details, see Mip Map Streaming API.

In Unity’s Viking Village demo project, Mip Map Streaming saves 25–30% of Texture memory, depending on Camera location.


To enable Mip Map Streaming, go to Unity’s Quality Settings (Edit > Project Settings > Quality) and enable the Texture Streaming checkbox. This reveals the settings specific to the Mip Map Streaming system. For details on each setting, see documentation on Quality Settings.

When you’ve done this, set up Mip Map Streaming on individual Textures, to allow the Mip Map Streaming system to stream each Texture’s mip maps from the disk into memory. To do this, select the Texture you want to apply Mip Map Streaming to, navigate to the Inspector window and view the Texture Import settings. Open the Advanced settings, and enable the Streaming Mip Maps checkbox.

If you’re developing for Android, you also need to open the Build Settings and set the Compression Method to LZ4 or LZ4HC. Unity requires one of these compression methods for asynchronous Texture loading, which the Mip Map Streaming system relies upon.

Unity loads mip maps at the highest resolution level possible while observing the Texture Memory Budget. For more specific control, or to fine-tune the Mip Map Streaming system’s automatic results, use the C# API to specify mip map levels for each Texture. For more details, see Mip Map Streaming API.

제한 사항

You can instruct Mipmap Streaming to calculate the required mipmap levels using one of the following methods:

If you don’t instruct Mipmap Streaming to calculate mipmap levels using one of these methods, Unity can’t calculate which mip level to use. This causes Unity to load the texture using low-quality mips that appear blurry.

The following systems don’t use standard Renderers. This means you must manually set the requested mipmaps for these systems or Unity loads the textures they use at low resolution:

  • 데칼 프로젝터 텍스처
  • Reflection probe Textures: Lower resolution mipmaps are a lookup table for roughness. Therefore, if Unity uses a lower mipmap level, it renders materials using the wrong roughness.
  • Textures in Unity’s Terrain system: Unity does not support Mipmap Streaming on Terrain Textures. This is because Terrain Textures need to be available at full resolution at all times to allow Unity to tile and blend the textures.
  • Shaders that handle texture UV coordinates differently from the Unity built-in shaders. Unity always assumes the textures are sampled using UV0 as stored in the Msh. Any shader based modifications of the texture coordinates, except for the scale and translation (see below), or the use of UV1, are not taken into account.

When a renderer is active, the mesh that renderer uses requires valid UV distribution metrics to calculate the desired mipmap level. Unity calculates distribution metrics automatically as part of the mesh importing process. You can also calculate this in a script using Mesh.GetUVDistributionMetric.

When Unity renders a streamed Texture directly with an API (such as Graphics.DrawMeshNow) the system has no renderer bounds or other information to calculate the mip level, so you need to set the Texture mip level explicitly (or disable Mipmap Streaming on this Texture). See documentation on Texture2D.requestedMipmapLevel for more details on how to manually set the mip to load.

Debugging Mipmap Streaming

Unity has a built-in Mipmap Streaming debugging view mode. To access it, click the Scene view control drop-down and select Texture Streaming. This view mode tints GameObjects the following colours, depending on their status in the Mipmap Streaming system:

  • Green for Textures that have reduced mipmaps due to the Mipmap Streaming system.
  • Red for Textures that have fewer mipmaps because the Mipmap Streaming system does not have enough resources to load them all.
  • 파란색 : 스트리밍이 설정되지 않은 텍스처. 또는 밉 레벨을 계산할 렌더러가 없음.

You can also write your own custom debug tools and visualizations using the Debugging API

Important : If you flag a main texture in your shader using the MainTexture property attribute, these textures will not be visible in debug mode. To work around this, always use a texture property named _Maintex to indicate the main texture of a material.

프레임 디버거
스트리밍 컨트롤러