# Introduction

![](/files/-ML4mdsvW7mfKfZdcFlr)

**Magic Lightmap Switcher (MLS)** is a powerful tool for Unity designed for dynamic switching and smooth blending of various lighting scenarios in real time. It allows you to create effects of changing the time of day, switching between different visual styles (for example, day/night, light on/off) or lighting animations without having to reload the scene. The plugin supports all Render Pipelines Unity (Built-in, URP, HDRP) out of the box.

## Main features

**Dynamic Lighting Switching:** Allows you to store multiple lighting presets for a single scene. Each preset contains its own lightmaps, Reflection Probes, material parameters, and global rendering settings (fog, ambient colors). Lighting can be instantly switched between these scenarios.

**Smooth Blending:** The main function of the plug—in is smooth interpolation between two lighting scenarios. Blending is supported:

* Color, directional lightmaps, and shadowmasks
* Cubic textures of reflections
* Material parameters (colors, slider values, textures)
* Global rendering settings (ambient colors, fog)
* Parameters of any components on game objects (for example, the intensity of the light source, the rotation of the object)
* Light Probes and Adaptive Probe Volumes

## Optimization

**Tile-Based Blending:** Heavy operations on blending light maps are performed not in one frame, but in parts (tiles). This distributes the computational load over several frames, preventing performance drawdowns (FPS).

**Cell-Based Culling:** The scene is split into a 3D grid. The blending system updates only the lighting data that is in the cell close to the camera and cells visible in camera, which significantly reduces the amount of data processed.

**Optimized blending of compressed textures:** For platforms that support modern APIs (PCs, consoles), blending compressed textures (BC6H, DXT1) is performed directly on the GPU using Compute Shaders. This avoids decompression in CPU memory, saving resources.

**Streaming processing:** Blending of Light Probes (if used) data is performed in the background thread, and the result is applied in the main thread, which prevents it from being blocked.Efficient memory management: The plugin enables checking of available system memory before starting the blending process and uses object pools to minimize garbage collection (GC).

## Integration

**Support for all Render Pipelines:** The plugin is fully compatible with Built-in Render Pipeline, Universal Render Pipeline (URP) and High Definition Render Pipeline (HDRP) without the need for additional configuration.

**Support for third-party solutions:** It has built-in [Bakery](http://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218) support, allowing you to integrate their data into a dynamic lighting system.Other integrations:

* [Magic Light Probes](http://assetstore.unity.com/packages/tools/utilities/magic-light-probes-157812)
* [Enviro - Sky and Weather](https://assetstore.unity.com/packages/tools/particles-effects/enviro-sky-and-weather-33963)
* [Cozy: Weather](https://assetstore.unity.com/packages/vfx/cozy-weather-207492)

## Restrictions

**Platforms without GPU compression support:** For platforms where there is no support for BC6H/DXT1 compression on the fly (mobile devices), blending in the RGBAHalf format is used. This can lead to increased consumption of video memory (VRAM).

**Forward+ and Deferred+ rendering modes:** In these rendering modes, reflections (Reflection Probes) are used as texture atlases, which makes their blending technically impossible in the current implementation. The support for blending reflections is only available in modes where they are used as separate cubic textures.

The compatibility table can be viewed [here](https://motiongamesstudio.gitbook.io/magic-lightmap-switcher/getting-started/compatibility).<br>

**Support the developer:** Anyone who can and wants to provide support to developer can do it [here](https://boosty.to/magic_tools)<br>

## Contacts And Documentation

* [Telgram Group](https://t.me/+mlqCOc74oIE3NzEy)
* [Discord Server - Magic Tools](http://discord.gg/p94azzE)
* [Forum Thread](http://forum.unity.com/threads/released-magic-lightmap-switcher-storing-switching-and-blending-lightmaps-in-real-time.1089247)
* [Twitter](http://twitter.com/evb45)
* [E-Mail](mailto:evb45@bk.ru)

## Other Our Assets

* [Magic Light Probes - High Precision Light Probe Generator](http://assetstore.unity.com/packages/tools/utilities/magic-light-probes-157812)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motiongamesstudio.gitbook.io/magic-lightmap-switcher/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
