General Settings

Editor Setup

Disable lighting "Auto Generate" option for the plugin to work properly.

If you are using Configurable Enter Play Mode, then for the plugin to work properly in playback mode, you need to check the "Reload Scene" option. Otherwise, blending will only work in edit mode.

Import MLS Package

Import the MLS package using the "Asset Store" or go to the "Assets âžž Import Package âžž Custom Package" menu and select the package in Windows Explorer.

If you do not need the scenes with examples and any related data, then you can exclude from the import the folders "Examples" and "Resources".

Project Setup

If you are using or intending to use the NGSS (Next Gen Soft Shadows) plugin, then you first need to follow the steps to install NGSS. Since NGSS patches the original CGIncludes files. This will undo the changes made by the MLS.

After importing the package, the Tools âžž Magic Tools âžž Magic Lightmap Switcher âžž Prepare Shaders... tab will become available in the main editor menu.

This window may look slightly different depending on the rendering pipeline you are using. You need to click the "Patch..." button for the corresponding rendering pipeline.

Therefore, when you click the "Patch..." button, the system will ask you to provide administrator rights for the console. When the copy is complete, the console will wait for any key press. This will happen twice. The editor will then need to be restarted for the changes to take effect. (This only happens for Built-In RP. SRP does not require console launch)

As written in the comments in the window, the changes do not affect the basic functionality of the shaders, they only contain some extras to support real-time lightmap blending.

If the patch is successful, the button will change to "Restore...".

You will see this message in the console if everything went well.

Deferred Mode In HDRP

Starting from the release version 1.0.0 Magic Lightmap Switcher also supports Deferred mode in HDRP.

To avoid spam errors in the console right after the shader patch, you need to add a Custom Pass Volume to the scene, which simply initializes some variables in the RP before starting rendering.

In the latest versions of the engine, a preab with this volume has already been added to the Quick Start scene, which will be imported along with the HDRP Support package. In older versions, due to differences in AssetsDatabase versions, the prefab will not be imported properly, so you have to create a Custom Pass Volume manually.

Create a new "Custom Pass" in the hierarchy:

Add the "MlsDeferredPrepass" object to the list:

Set Injection Point to "Before Rendering":

Support For Texture Arrays

Texture Arrays require a minimum shader model of 4.5, in addition, some corrections in standard and URP/HDRP Lit shaders are required for the option to work correctly. Edited versions of shaders for all RP are located in the Magic Lightmap Switcher âžž Shaders folder

Last updated

Was this helpful?