- Home /
Dynamic Lightmaps?
Hello, I am very new to Unity and I am having lots of fun learning how to use it :) For my first project, I am making a small, strategic RPG sort of game and I was wondering if there is a way that I can use a script to 're-bake' a light map for my outdoor environment. I would only use a very simple light map with baked hard shadows of a single sample and a low resolution. I would do this every time the player left an indoor area and every half hour (game time) so all the trees etc. would cast shadows in accordance to where the sun it, to give the outdoor environment a nice day and night cycle.
Thank-you for your time :)
is it only when you go in and out of areas? or you mean continues that the sun rises and sets while playing?
Both, I want it to update when you enter the outdoor envinornement, and update every few $$anonymous$$ites your outside (not constantly)
You could fake it. Let's say that on average there are 12 hours of daylight(in reality, there are more or less depending on location and time of year). You could then pre-calculate however many lightmaps you want following the path of your sun. For every 30 $$anonymous$$utes that would be 24 lightmaps.
You could probably get away with fewer and reuse those at the hours around sunrise and sunset, and then use other methods to create the correct lighting effects.
Wow, I never thought of that :) That would be great, thanks for the advise!
Answer by Owain · Jan 18, 2012 at 10:45 PM
Both, but it wont be constantly updating, only once every few minutes