How to change the backed light maps for different layouts ? Here I am using two architecture models Each architecture models has different objects when try to switch the layouts the light maps are not get changing so how to change the light maps when loading the new layouts?
Asked
Active
Viewed 8,865 times
1 Answers
1
Lightmaps are most commonly applied to static objects in applications that use real-time 3D computer graphics, such as video games, in order to provide lighting effects such as global illumination at a relatively low computational cost.
If you want your shadows to change dynamicaly, you need to make your objects dynamic and apply dynamic light to them. Because lightmaps are built only in editor. The only way to change them in unity realtime is to switch different baked lightmaps.
There is an example on community with sample classes. This example shows you how to switch between day and night lightmaps, but you can use it for your own purposes. You can read more about it here: LightMapSwitcher

Markiian Benovskyi
- 2,137
- 22
- 29
-
@MickyD Lightmaps are baked in editor using static lightning. The only way to change them in real time is to switch different baked lightmaps. Otherwise OP should use realtime lights – Markiian Benovskyi Feb 03 '18 at 15:06
-
My original comment is based on your original post. Agreed – Feb 03 '18 at 15:50
-
Mark Benovsky Thanks!... so here I want to access my lightmap dataset or textures? – Chuva Feb 03 '18 at 20:09
-
You can switch built lightmap textures – Markiian Benovskyi Feb 03 '18 at 20:17
-
I used the script it showing an error the namespace NaturalSortComparer could not found Mark Benovsky – Chuva Feb 03 '18 at 20:24
-
Is there any way to move the backed textures in real time Mark Benovsky – Chuva Feb 04 '18 at 13:45
-
There are two voids to switch the lightmaps in thr class from that example, before that you need to add the script to object and apply your lightmaps. This is the basics of unity workflow – Markiian Benovskyi Feb 04 '18 at 15:16
-
Now you need to call methods from that script on that object – Markiian Benovskyi Feb 05 '18 at 09:30
-
Using either buttons with assigned methods of that script, or pass script to your controller and call methods from it – Markiian Benovskyi Feb 05 '18 at 09:56
-
Not sure about it working in the latest version of unity. But seems ok, there are many options to do this. He is changing the lightmaps on buttons. – Markiian Benovskyi Feb 05 '18 at 12:17
-
My lighting data is not changing over there how to fix this? – Chuva Feb 06 '18 at 08:15
-
Seems that easier for you will be using of dynamic lights, not static. Yes you need to apply texture in editor, just like you sent in that video. And then call methods to change the textures – Markiian Benovskyi Feb 06 '18 at 09:05
-
Link to LightMapSwitcher is dead. – glenneroo Feb 01 '22 at 10:52