[RELEASED] Magic Lightmap Switcher - Storing, Switching and Blending Lightmaps in Real-Time

Hello everyone!

Thread moved from Work In Progress forum

Magic Lightmap Switcher is a Unity editor extension that will allow you to store baked lightmap data and then switch between its instantly or interpolate smoothly.

**The following data is involved in switching and blending:**‌

  • Lightmaps
  • Lightprobes
  • Reflection probes
  • Light sources settings
  • Skybox texture
  • Scene fog settings
  • Any custom data such as post-processing settings, Volume component settings in SRP, or variable values of any of your script‌

**System features:**‌

  • Switching and blending all available baked data in the scene at runtime
  • Using shaders and multithreading for system operation, which allows you to maintain high performance
  • Support for multiple lighting scenarios for one scene
  • Automatic baking and storing process of lightmaps in turn order‌

Custom shaders:

The asset will work with any custom shader, unless that shader uses its own GI functionality. If your shader calls on Unity’s built-in functions to render lightmaps, reflection probes, lighting from light probes, and etc., then you don’t need to worry. Everything will work by default.

For those using custom lighting features. Write to the developer on any support channel. It’s pretty easy to add blending and switching support to your shaders.

Integration:

Tested with assets:

Quick Start for Lite Version

Things to do:

  • Preset manager (added in v1.2)

  • HDRP and URP support (implemented in a separate version)

  • Eliminate possible light leaks while blending lightmaps

  • Supports Panoramic and 6-sided skybox shaders

  • Support for Bakery Lightmapped Prefabs

  • Support for Bakery RNM and SH maps (added in v1.34)

  • Blending and switching support for Bakery Volumes (if at all possible and efficient)

  • Own lightmapped prefabs (for non-Bakery users)

  • API for easy modification of custom shaders

  • Enviro support

I would be grateful for any comments. Good luck to everyone with your projects!

Asset Store Lite Version (Built-In RP Only)
Asset Store Pro Version (Built-In + URP + HDRP)
Discord Server
Magic Lightmap Switcher Manual

2 Likes

HDRP version will be in this updated asset or in separate asset ?

SRP (URP + HDRP) will be in a separate asset. As it requires a lot of work and support

3 Likes

Looks interesting but… am I being blind? Is there an asset store link? (it’s released?)

1 Like

Oops, you’re right. Here is https://assetstore.unity.com/packages/tools/utilities/magic-lightmap-switcher-built-in-rp-192332

@Eugene-B1 , please make standalone demo with test scene for this asset :slight_smile:
This will be useful for determining performance

Yes, definitely. Once done with SRP support. Such a demonstration was, by the way. But for earlier versions of the plugin. :slight_smile:

Version 1.2 has been sent to the store. Will be available within 2 days.

Bug Fixes:

  • An error related to paths conflict due to which the interface does not work correctly.
  • Shader restoring is not possible on systems with limited user permissions.
  • An issue has been encountered where the notification that all lightmaps have been successfully stored will pop up indefinitely if you cancel the bake and store process.
  • An issue was found that is causing errors while building the project.
  • Reflections work with errors in deferred rendering. Implemented support for system operation without support for deferred reflections.

Improvements:

  • Added preset manager. Now you can manage all scene presets from one place and edit them quickly.
  • Added a new manager option. Clear Default Data Folder - Allows you to choose whether to delete duplicate lightmap data in the default folder.
  • Added tooltips to manager options. To see this, hold the mouse cursor over the option name.
1 Like

Waiting for URP, super excited for it! :slight_smile:

1 Like

URP support has ended. Tested on 3 verified versions 7.5.3, 10.3.2, 11.0.0 for engines of versions 2019.4.21f1, 2020.3.1f1 and 2021.1.4f1. This may also work for intermediate versions, however, this needs to be verified.

2 Likes

Version 1.3 (buil-in) has been sent to the store.

Bug Fixes:

  • An issue was found that is causing errors while building the project.
  • Fixed a bug that prevented adding multiple fields to the Custom Blendable.

Improvements:

  • The Custom Blendable module has been completely rewritten.
  • Color fields are now recognized by Custom Blendable.

A message to all potential buyers.
Do not use the plugin review submission form as a bug report submission form. Instead, use any of the specified communication channels. In most cases, the developer responds within a few minutes.

1 Like

Update 1.31 has been sent to the store.

Bug Fixes:

  • Changed code to work around the situation when the range of a light source of type Area increased infinitely.
  • Fixed a bug that prevented editing scene lighting settings when the preset manager window was active.
  • Fixed a bug that caused spam in the console when adding multiple empty objects to the blending queue.

Improvements:

  • Added the ability to select a scenario in which the data after re-baking will be overwritten.
  • Added a warning in the console and in the interface that is shown when an error is detected in the blending queue data.

Testing of the SRP support package (URP + HDRP) begins. Hope it doesn’t take too long.

1 Like

Update 1.32 has been sent to the store.

Bug Fixes:

  • An error that caused blending to stop if the object has “scaleInLightmap = 0” or “lightmapIndex = -1”.
  • Texture format error for Android platform.
  • Light references are lost after reloading the editor.
  • A bug due to which, when creating a new preset, data in all existing presets is overwritten.
  • A bug that caused the rotation values of the light to reset to zero during the first edit.

Improvements:

  • Ability to move the plugin to any project folder.
  • Ability to specify the path to store data in the “Resources” folder.

So, after much thought, I came to a solution. Since I was able to get HDRP to work in Deferred mode, albeit without support for blended reflection probes for now, I will release URP + HDRP support as one package, however I will mark it as version 0.9 and as a beta version until Deferred support will not be fully implemented. In addition, the Built-In version will be considered the LITE version, and the URP + HDRP package will also include Built-In and will be considered the PRO version. Thus, users who have already purchased the Buil-In package will be able to upgrade to the PRO version with a discount. For the rest, the package will be shipped at full price (I think $50 would be fair for the current version), it should be noted that the price will be increased when all planned features are implemented.

Now I am engaged in combining the changes of the latest version of Built-Int (1.32) with the second package. When this is done, I will run some tests on a complex project (eg ArchViz), show the result and then send the package to the store. Good luck for me!

3 Likes

Any news about URP?:slight_smile:

If all goes well, I will ship this to the store today. :slight_smile:

2 Likes

So two news.

The 1.33 update for the Built-In version has just become available in the store.

Bug Fixes:

  • Fixed a bug due to which reflections were incorrect for all bakes in the queue, except for the first.

Improvements:

  • Changed blending mechanics to support batching.
  • Added the ability to save the state of objects in presets. (enablend/disabled)
  • Optimized lightmap blending code to eliminate unnecessary computations.

AND

The Built-In + SRP version has been sent to the store and will be available in a few days.

1 Like

Awesome! Cannot wait to try URP version and integrate to my project with Bakery;)

1 Like