- Home /
Day Cycle and LightMapping
Hi there,
I'm making a game with a day cycle (Like Zelda 64 Ocarina of Time) and my question is.
Making a realtime shadow consumes a lot computer process. Can I bake a few lightmaps and 'blend' according to the sun position? Like sunset, sunrise, midday? Or there is another way to do it better?
Answer by _MGB_ · Mar 22, 2011 at 08:48 PM
You could try a 'horizon map' & shader? Basically it's a texture that holds two values: what time the sun touches it and what time the sun leaves it. A shader can then interpret this and shade appropriately given the current time.
I'll keep searching about this. Thanks for the tip! $$anonymous$$aybe I'll use real-time shadows, but a daycycle in a city with night lamps, will be a lot of calculations! I'm trying to avoid it at all costs!!
Answer by efge · Mar 22, 2011 at 09:13 PM
You could use Deferred Lighting. It supports one Directional Light with realtime shadows and lots of other lights without realtime shadows.
Take a look at the reference for quality and performance optimization:
Shadows in Unity and Directional Shadow Details.