here are a couple of pics from a dynamic day-night-system I have been using for a while now.
I wanted to show this for a while now.
The systems allows to create sky-settings as prefabs. these prefabs hold texture, color, weather properties and are used by the weather system to create the environment. I have 3 types of skies: day, night and dusk/dawn. dusk and dawn are dynamically blended with the current day or night sky allowing for smooth transitions ‘all day long’.
Weather means rain and thunderstorm (I once used a snow setting for another game using this system, but I did not have it setup in this game to make screens). Weather is dynamically applied if a sky prefab allows for it.
i’ve been using this system for about two and a half years now. I never noticed that the trees lack shading. I guess I’m just too blind-spotted to have noticed - more than two years working with the same system will do that. Anyway, I fixed that. Will post a screenshot later.
The skybox is actually a skysphere, I am using sky textures from cgtextures.com, they have some great hiresolution sky textures.
depending on time of day two textures (dawn texture and day texture, or dawn texture and night texture) are blended together.
on the issue of integrating of weather services or location data to influence the environment:
I’ve been down that path… it takes a really long time to use - e.g. geolocation - to setup the sun’s position, lighting, shadows, etc. and make it look good and realistic and - at the same time - meet your game design requirements. after a week of trying and tweaking I just implemented my own system.
I never tried to integrate weather services though I imagine it being fairly easy. however such a feature just would not fit the games I use my system in.
I calculate the sunlight color and store it in a static shader variable (color). the shader used this color in the emission property rather than in ambient/diffuse, fixed that.