Magic Lightmap Switcher
  • Introduction
  • GETTING STARTED
    • Compatibility
    • General Settings
    • Quick Start
    • FAQ
  • Usage
    • Scenes Workflow
    • Custom Blendable
    • Skybox Blending
    • API
  • SYSTEM COMPONENTS
    • MLS Manager Window
    • MLS Preset Manager
    • MLS Light
    • MLS Static Renderer
    • MLS Dynamic Renderer
  • DEVELOPMENT
    • Latest LITE Version (1.37.3)
    • Latest PRO Version (1.2.1)
    • LITE Version Changelog
    • PRO Version Changelog
  • INTEGRATIONS
    • Bakery - GPU Lightmapper
    • Enviro - Sky and Weather
  • CONTACTS
  • DISCORD
  • TELEGRAM
  • TWITTER
  • EMAIL
  • FORUM THREAD
Powered by GitBook
On this page
  • Editor Setup
  • Import MLS Package
  • Project Setup
  • Deferred Mode In HDRP
  • Support For Texture Arrays

Was this helpful?

  1. GETTING STARTED

General Settings

PreviousCompatibilityNextQuick Start

Last updated 1 year ago

Was this helpful?

Please note that the asset has two different versions.

version which only supports Built-In RP and version which supports Built-In + URP + HDRP.

The manual is identical for both versions.

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

The plugin can work in the lightmap switching only mode without the need for a shader patch. However, keep in mind that this can cause the application to slow down, while switching lightmaps using shaders is instantaneous.

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.

Some users do not have administrator permissions on the PC, however, these are needed to be able to overwrite files on the system drive in the CGIncludes folder.

If the patch failed then try the following steps: (this only needs to be done once)

  1. Right click on the Hub shortcut

  2. Go to the "Properties".

  3. Go to the "Compatibility" tab and Check the "Run this program as administrator" option.

  4. Repeat the steps for the shortcut of your Unity Version.

  5. Restart your PC.

If these steps also did not help, or for some reason your shaders turned out to be corrupted, then in the Magic Lightmap Switcher âžž Editor âžž Dependent Resources âžž Shader Sources âžž Standard folder you can find archives with original and modified shaders. Just replace the shaders in the CGIncludes folder of your engine version.

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...".

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":

If you have problems with transparent objects, then try changing the Target Depth Buffer to Custom.

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

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