Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Enable mipmap streaming

Enable mipmap streaming, make a texture work with mipmap streaming, and change the mipmap level of a texture.
Read time 2 minutesLast updated 19 days ago

To enable mipmap streaming, follow these steps:
  1. Go to Edit >
    Project Settings

    ?

    > Quality.
  2. In the Textures section, enable Mipmap Streaming.
By default, this enables mipmap streaming for all the cameras in your project.
In the Editor, mipmap streaming is active in both Edit mode and Play mode by default. For more information about configuring mipmap streaming in the Editor, refer to Editor settings

Make a texture work with mipmap streaming

Follow these steps:
  1. Select a texture asset in the Project window.
  2. In the Texture Import Settings window, select Advanced to open advanced settings.
  3. Ensure that Generate Mipmap is enabled.
  4. Enable Stream Mipmap Levels.
If you build your project for Android, you must also follow these steps:
  1. Open the Build Profiles window.
  2. Set Compression Method to LZ4 or LZ4HC.

Lightmaps

To enable mipmap streaming for lightmaps, follow these steps:
  1. Go to Edit > Project Settings > Player.
  2. In the Other Settings section, enable Lightmap Streaming.
You can edit the mipmap streaming settings of the lightmap assets in the same way that you can edit settings of any other texture, but they reset to their default values when Unity regenerates the lightmaps. To solve this, you can tell Unity to apply these values when it generates the lightmaps. Use the Lightmap Streaming Enabled and Streaming Priority in the Player settings window.

Custom meshes

If you create a custom mesh in a Unity script, Unity doesn't automatically calculate the UV density of the mesh. This means Unity loads the wrong mipmap levels.
To prevent this, do either of the following:

Unsupported objects

Unity can't automatically calculate the correct mipmap level for textures on some objects, because it can't get the mesh and UV data it needs from them. This includes objects such as:
  • Decals textures.
  • Reflection Probe textures, because they use mipmap levels to store lookup tables for material roughness.
  • Sprites, which use a Sprite Renderer component.
  • Objects rendered with Entities Graphics.
  • Objects that generate their geometry procedurally at runtime, such as Particle Systems, Visual Effects, Line Renderers, and Trail Renderers.
  • Shaders that use UV texture coordinates in a channel other than Mesh.uv (also called UV0).
  • Shaders that change texture coordinates other than scale and translation.
For these objects, set the mipmap level manually. If you don't do this, Unity uses low-resolution mipmap levels, which might display as blurry depending on the distance from the camera. Refer to Override the mipmap level of a texture.

Additional resources