# Preload mipmap levels

> Use the API to preload mipmap levels to avoid textures pop-in when you enable a camera.

If you enable a camera at runtime, mipmap streaming needs time to stream the mipmap levels into memory.

You can use texture preloading to prevent this. Do the following:

1. Add a **Streaming Controller** component to the disabled camera. For more information about this component, refer to [Configure mipmap streaming](/engine/6000.3/manual/materials-and-shaders/textures/texture-loading/texture-streaming/configure.md).
2. Call the [StreamingController.SetPreloading](/engine/6000.3/script-reference/unityengine/streamingcontroller/setpreloading.md) API on the camera to preload the mipmap levels.

Use [StreamingController.CancelPreloading](/engine/6000.3/script-reference/unityengine/streamingcontroller/cancelpreloading.md) to cancel preloading.

You can use the following APIs after you enable preloading:

* [StreamingController.IsPreloading](/engine/6000.3/script-reference/unityengine/streamingcontroller/ispreloading.md) to check if the camera is preloading.
* [Texture.streamingTextureLoadingCount](/engine/6000.3/script-reference/unityengine/texture/streamingtextureloadingcount.md) and [Texture.streamingTexturePendingLoadCount](/engine/6000.3/script-reference/unityengine/texture/streamingtexturependingloadcount.md) to check how many textures Unity is still loading mipmap levels for.

If these APIs return values that indicate Unity has finished preloading, you might need to wait a few frames before you enable the camera to make sure preloading has finished.
