Dynamic Weather // Day night Cycle

Update I’m also working on a customizable Day/Night cycle that will work with the time of day.
here is the → WIP <–**
**

It works with a 24h system that can be sped up or down.
Differnt tints can be added at different points of the day.
The clouds are not part of the skybox!
This package will be released to be used in your Unity Projects as a free drag and drop prefab when it is done.

I tried to make a dynamic weather system for First Person Games in Unity.

This is bad Weather:
Weplayer here
The slider controls the weather[/size]
I can’t seem to find anywhere if you can control the wind settings for trees and grass with scripting, anyone want to help on that?

I looked into it and found nothing, maybe something like this

var terrain : GameObject;
var other;
other = terrain.GetComponent("Terrain");
other.speed = 1;

Just an idea, since nothing appears in the documentation, maybe as a mod.

There must be a way but it isn’t documented, so unless someone already found it OR you try guessing/reflecting OR if a Unity dev will tell you, I don’t think you’ll find the way to change wind speed :stuck_out_tongue:

IntelliSense came up with some grass stuff for me, but I didn’t see anything for trees.

Terrain.terrainData.wavingGrassAmount
Terrain.terrainData.wavingGrassSpeed
Terrain.terrainData.wavingGrassStrength
Terrain.terrainData.wavingGrassTint

Not sure if they’ll work, but maybe you can give them a try.

I tried to catch the value of Terrain.terrainData.wavingGrassSpeed inl a variable but Unity editor crashes on me when I run the script.
I hope this will be included in Unity 3.

Unity 3 includes wind zones :slight_smile:

Weird that no one has said this, but that looks and sounds fantastic. :slight_smile:

I love the transition.

One thing that would make it better was if you had an animated skybox or something as well.

I’m working on a Day/Night cycle right now :smile:

Wonderful! dy/night cycle is something that I would like to do too, please show use when it’s done, I’m really curious :smile:

This is what I have so far

edit: Oh and I can’t get the directional light to work with grass :?. Does anyone know how to dynamically light the grass on a terrain?


351596--12216--$weathergui_112.jpg

http://forum.unity3d.com/viewtopic.php?t=45988

Here’s a topic where a workaround has been found :wink:

Did you script everything? I mean, it is difficult to setup an animation for the sun in order to do a cycle?
Sorry but has been a while since I opened Unity, now I’m building a huge set in Softimage and I haven’t tried anything, so any help will be appreciate :smile:

I can get the shader to work, but it looks crap with direct lighting.
An ideal shader would be a grass shader that adapts to the light but can shade the grass on both sides.
A bit like the vegetation-leaves shader.

@Nick3D the scripting wasn’t that hard. I think most of the scripting is finished.

I now added a 24H cycle to the demo!

just wondering if this is finished, i really could use it

This looks so beatiful. Great work dude.

I will surelly use it!

Hello,

This is great !! :wink:

How to use it if it is possible, can i download a unitypackage or other and can i use it even in a commercial way ?

Thanks a lot for your work and sharing !! :wink:

++
:slight_smile:

Here is a package.
If you want to add the TOD to your scene just drag the prefab in your scene and assign skyboxmaterial1 as your skybox.

Mind this is a work in progress, I haven’t had the time to make it very user friendly.
With all of the experience from making this ToD I’m thinking of redoing it and making it a lot better.

360642–12517–$todpackage_132.unitypackage (760 KB)

am i doing something wrong? when I drag it onto my scene, i get a null reference exception

This works great, good job! Thanks for your hard work!

This is awesome! Good job

But 2 things how come when you move the light fades faster like it speeds up the process?

And how can I slow it to where it’s a little more realistic. It takes like 25 seconds to cycle through. Something like 10 or 20 mins would be awesome.

Is there a way to do this?