Day, Night, Weather

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.

The night is a bit too dark, I guess.

any comments welcome.








Looks really good, a webplayer would be great.

Great so far! I’m thinking of the old Operation Flashpoint games when I look at the shots. Your system is improved compared to that one though. :slight_smile:

Indeed - particularly the way the foliage provides no hint about where the sun is coming from! They all have a weird overcast-but-not look to them :\

hey azeitler!.. that´s very nice… are you changing skybox too? or just colors and sun Pos Rot… ?

i´m interested to put something like this in my game, Unity detects local time, and loads settings according to that…

You know what I would lke to do… Connect to weather.com and show time/weather based on that. How neat would that be!

Eitehr way, very cool system you got there. I agree that the trees dont look right but the Skybox and sun looks amazing.

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.

Fresh eye never hurts. Looking forward to see the update! What was wrong with the trees by the way?

had a chance to grab a couple of images…

this is the old shading:

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.

now it looks like this:

also fixed the night… it’s less dark now:


can we get a webplayer