Chuva
Chuva

Reputation: 57

How I can change lightmaps at runtime in unity?

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?

Upvotes: 3

Views: 9601

Answers (1)

Markiian Benovskyi
Markiian Benovskyi

Reputation: 2161

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

Upvotes: 1

Related Questions