Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UniSky v1.2 - Procedural Weather Update

Discussion in 'Made With Unity' started by Chris Morris, Feb 13, 2011.

  1. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Well considering I have an ATI card I guess I can live with this. But just so you know I've been checking like 4x a day all this week =) Darn you and your awesome work ^^
     
  2. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    since your on the edge of release now, could we check it out in a webplayer? :D

    and is there a price increase? should I buy before new release?
     
    Last edited: Mar 5, 2011
  3. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    I'm going to put up a webplayer tomorrow night so you can at least play around with it while you are waiting.

    @grfxman - Nope, we won't ever increase the price on this tool, so no rush buying it.

    Thanks for your patience guys!
     
  4. chaos1986

    chaos1986

    Joined:
    Mar 29, 2009
    Posts:
    230
    Did u have chance to get a good starfield in?
     
  5. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Got to admit I'm excited about where this Plug-In is heading. Looking forward to testing the web player.
     
  6. lucidcoder

    lucidcoder

    Joined:
    Mar 23, 2010
    Posts:
    138
    Quick question, will it be possible to keep the sun stationary in the sky (like, lock the time-of-day in the script so that the day-night cycle doesn't occur)?
     
  7. SixTimesNothing

    SixTimesNothing

    Joined:
    Dec 26, 2007
    Posts:
    167
    @Sigma Just set Speed of Time (in the Sun tab) to zero, this will stop time from progressing. Also make sure you have Use System Time turned off.
     
  8. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @chaos1986 - I disabled the scrolling stars like you mentioned, but didn't replace the default star field texture. It's already at a pretty high resolution, and I figure it serves the general purpose not to have too big of a texture.

    Still working out the last bug (occurring on Macs/OpenGL) which is quite a hard one to figure out. I promise I'm working hard to get this update ready, so stay with me and thanks again for being patient.

    Now for the webplayer, which has a bit of a story. For whatever reason, Unity has decided to keep WindZone scripting off limits. It isn't documented, and the class itself is unaccessible (dear Unity, please get around to changing this). I found a workaround hack, but I just found out that it doesn't work in webplayer builds. So my choices were to release a webplayer without the wind or release a standalone build. I know it's a little more inconvenient, but I chose to release a standalone because the wind is just so crucial to the scene :)

    I've attached a Windows build of the included example scene. I'd suggest running in windowed mode for now because in full screen, the lightning acts a little broken - I'm working on a fix for that. You can download it here:

    http://sixtimesnothing.com/resources/UniSkyv1.2Preview.zip

    Lightning is set to occur often, the weather step (speed) is cranked up so you can see a full cycle fast, and the storm length is set to infinite.
     
  9. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Thanks for the preview. Its sad about wind in the webplayer cause that all we build to I hope Unity helps soon.
     
  10. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Sorry to double post. But I just watched the Demo I downloaded and the video doesn't do it justice that's amazing. As soon as you have it working in a webplayer I am buying it and adding it to our Rogue demo. FANTASTIC WORK !!!!!
     
  11. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    I ve just tried preview on my notebook with Intel 965 and it caused BSOD. I know that this graphic card is crap, but unity runs well (of course slow).
     
  12. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @grfxman Thanks! I hope Unity changes that soon, it seems like a no brainer to have script access to WindZones (and quite a few other unaccessible components).

    @Demostenes - Hmm.. I'm thinking because of the sandboxed nature of Unity development and builds, that the BSOD you are getting doesn't have to do with UniSky. Unless I get more feedback similar to this, I'm going to have to chalk that up to either a Unity bug or your machine. Sorry you got that result - if I could reproduce it I would try to help you out.
     
    Last edited: Mar 8, 2011
  13. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    Well, it can be something in unity, I was able to BSOD even my normal computer by just playing with values in new pro water (i put tiling like 10000, or some stupid value like that).
     
  14. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    I have nearly experience like yours but not bsod and unity specific, my notebook acer 4740g was shutdown itself when the gpu temp reaching 95+ celcius, specifically when using graphic intensive programs like games, unity, modelling, use this tool to monitor you gpu temp, another probable cause would be faulty hardware, dusty casing could be causing the fan not optimal to unleash the heat,buggy driver, un-updated driver, to make sure you can also use this tool to narrow down more specific which driver causing you the bsod.
     
  15. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    This weather system is amazing. There are few amazing plugins like this in asset store and i really think that Unity Tech should include those in next version of Unity. It would be good if they would give you some certain ammount of money and then this feature would be used in indie licence in next version.
     
  16. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Well I bought this yesterday. And was wondering if Unity had gotten back to you yet about those issues?
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Amazing demo you got there. Just a Little question, the grass animation on your demo looks different it's good actually, are they affected by wind zone or just default Terain Wind engine?
     
  18. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I am having an issue with 1.1. My camera is 8000 in X and 8000 in Z. When I set Unisky to that camera everything works properly except the clouds they are a disk far off on the horizon.
     
  19. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    @Chris Morris

    I guess my opinion on the wind zones is scrap the the Unity ones and make your own invisible weather station object that we could add in the scene where we want. Just check distance to local weather stations and avg. the weather variables between them based on the distance as a ratio modifier. This way you could add your own weather station variables anyways such as cloud coverage, participation %, wind direction, strength, rain or not etc... If the player is not within range of any weather station then go to default settings on the Unisky setup.

    To be honest I think I was going to implement something like this on my own anyways as the wind zones just don't offer the control that something like this would.

    @grfxman

    You will want to set the position x,z of your Unisky object to the same position of the camera you are using so it is at center. I actually just drag the whole Unisky object around with my object in the update script anyways else you start to get some deformations as you get further from the center of the dome. Below is what I'm trying to say though it is definitely not a complete sample

    Code (csharp):
    1.  
    2. function Update(){
    3.     myUniSky.transform.position.x = myPlayer.transform.position.x;
    4.     myUniSky.transform.position.z = myPlayer.transform.position.z;
    5. }
    6.  
     
    Last edited: Mar 10, 2011
  20. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Sorry for the double post but I thought it'd be better if I put this one in it's own. In my world I wanted to add a haze fog effect on the horizon during the day and darken up the horizon at night so I used the in game fog effect. The problem was that when it turns to night time the white fog looks really bad at night. So I made this script to change the color of the fog with the sun rise and sun set events and I think it makes those times a lot more dramatic. The only problem as of yet that I haven't figured out is that the moon is turned into the color of the fog since it is so far away. I'm sure this is just a matter of changing it's shader's draw order but I just haven't had the time to tinker with it yet. When I do I'll post the fix. But for those of you who want to use haze in your scene here you go =)

    Code (csharp):
    1.  
    2. var SunObject : Transform;
    3. private var fogColor : Color;
    4.  
    5. function Start(){
    6.     fogColor = RenderSettings.fogColor;
    7. }
    8.  
    9. function Update(){
    10.     var testColor = fogColor.r*(SunObject.localPosition.y/20000)+0.01;
    11.     if (testColor <= fogColor.r  testColor >= 0){
    12.         RenderSettings.fogColor.r = fogColor.r*(SunObject.localPosition.y/20000)+0.01;
    13.         RenderSettings.fogColor.g = fogColor.g*(SunObject.localPosition.y/20000)+0.01;
    14.         RenderSettings.fogColor.b = fogColor.b*(SunObject.localPosition.y/20000)+0.01;
    15.     }else if (testColor < 0){
    16.         RenderSettings.fogColor.r = 0;
    17.         RenderSettings.fogColor.g = 0;
    18.         RenderSettings.fogColor.b = 0;         
    19.     }else if (testColor > fogColor.r){
    20.         RenderSettings.fogColor = fogColor;        
    21.     }
    22. }
    23.  
    Oh I should mention I left the calculations for r,g,b separate because I have plans yet to make the red transition a little slower than the others so that the fog is a little more red at the sun set time etc.. Just haven't done it yet.

    Also my base fog setting in rendersettings are...

    Fog: Enabled
    Color: r: 255, g: 233, b: 205, a: 255
    Mode: Exponential
    Density: 0.001
    Start: 0
    End: 300

    @Chris Morris
    Quick update on this code snippet I posted.. You can use it if you want as a feature. But mainly why I am directing this at you is please add Fog { Mode Off } to your moon shader for next release. Thank you!

    In the meantime for others using this if you add Fog { Mode Off } after
    Code (csharp):
    1.      Pass
    2.     {
    3.         Blend SrcAlpha OneMinusSrcAlpha
    in the Moon Shader it will work fine
     
    Last edited: Mar 10, 2011
  21. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Thanks got it working. It was the cloud viewing distance slider that was killing it.
     
  22. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @rea - It's actually just the default terrain wind

    @grfxman - What you found is actually a bug that is fixed in the new version. Here's where to fix it if you want to do it now:

    Just a single line in the "CumulusPerlinLayer.shader":

    change this line:

    o.t0 = (_v3CameraPos - mul(v.vertex, _Object2World)).xyz;

    to this:

    o.t0 = (float3(0,44931.74,0) - mul(v.vertex, _Object2World)).xyz;


    Then you can keep your cloud view distance at whatever.

    @rutecht - Thanks for the suggestions! The moon "fog off" is in the new version as well. The automated weather has a fog system of its own now too.

    As for the wind effects in the webplayer, implementing my own wind effects would be a massive undertaking if not impossible (getting references to the tree "bones" etc.). I think this is something that Unity just needs to take care of for the sake of the community.


    To everyone - we've been wrestling with this ATI bug for the past few days and we think we've nailed it so a submission to the Asset Store today is very likely. I'll let you guys know - it's been forever since the planned release, so I cannot apologize enough to those of you waiting patiently. Software is a hard thing to put a date on :D
     
  23. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Submitted to the Asset Store! Keep an eye out
     
  24. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    It's out in the asset store :) Very happy to have the update but I'm having major issues setting it up. When I add step 7 to my main camera I end up with this...

    And I get a fuzzy boarder around my scene like this:

    http://www.havocgames.net/media/screens/problem.jpg

    And yes I have completed each instruction exactly as written in the readme.txt file... any idea where I went wrong Chris?
     
    Last edited: Mar 11, 2011
  25. SixTimesNothing

    SixTimesNothing

    Joined:
    Dec 26, 2007
    Posts:
    167
    @msken Does the new example scene work ok for you or does it show the same artifacting?
     
  26. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    The test level works fine, I just made a prefab of the sky and main camera and dragged into my scene, then made my own terrain a parent of unisky and it works perfect. No clue what I'm doing wrong, but this has worked for now. Only issue standing out now is at night still looks exactly like the daytime...
     
    Last edited: Mar 11, 2011
  27. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    I just spotted a little issue with the the prefab that is probably causing this - we'll update this ASAP
     
  28. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Get..
    UnassignedReferenceException: The variable textGO of 'CameraRain' has not been assigned.
    You probably need to assign the textGO variable of the CameraRain script in the inspector.
    CameraRain.Awake () (at Assets/UniSky/Weather/CameraRain.js:54)

    NullReferenceException
    RainCloudLayer.Awake () (at Assets/UniSky/Weather/RainCloudLayer.js:110)

    NullReferenceException: Object reference not set to an instance of an object
    Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
    UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
    CameraRain.Update () (at Assets/UniSky/Weather/CameraRain.js:117)

    And it crashes
     
  29. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    Your first two errors are just simply not following the directions. (I don't mean that to sound like a jerk, I got them too at first until I followed the directs word for word) Your third error is the same as mine.
     
    Last edited: Mar 11, 2011
  30. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Actually those errors shouldn't be there at all.

    Delete "CameraRain.js" - the script shouldn't even be in the package.

    The updated version solves these issues, and will likely be on the Asset Store soon. Sorry for the misfire, everything will be resolved soon and I will let you guys know when it's good to download the new version.
     
  31. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    Great to know :) Thanks for the speedy response!
     
  32. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
    Ahoy. I'm trying to get some sunny screenshots updated using Unisky today, and having updated I can't seem to produce a non-stormy sky. I've dragged all weather sliders to '0', but there's nothing but grey up there~

    So my question is, if I don't want to use the weather effects, do I need to follow your instructions still where you attach the new scripts to the camera? And what's preventing me from seeing blue sky again?

    cheers
     
  33. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @chad - you need to disable the weather: to do this you need to go to the weather tab and uncheck the box labeled "Automate Weather?".

    After you uncheck that you basically have UniSky 1.1 as it was, and can control the cloud cover using the clouds tab as before.
     
  34. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    I suppose no water effects are applied to meshes like in rainscape?
     
  35. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
    Right, I figured as much, and so that's what I did initially, but still remained.. I'll try a restart.
     
  36. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    The current version has been corrected as mentioned earlier.

    Chad, I recommend redownloading if you are still running the initial release. This might solve the issue you are getting.
     
  37. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
  38. MatthewJCollins

    MatthewJCollins

    Joined:
    Dec 3, 2009
    Posts:
    372
    This looks really great Chris! Nice work! I may have to pick up a copy. :)
     
  39. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    How does it handle day/night? I mean shading and everything...
     
  40. SirLancelot

    SirLancelot

    Joined:
    Dec 30, 2009
    Posts:
    144
    It looks fantastic - thank you so much for this great update! Can't wait for 1.3 with snow. Hope it will be the same quality like this update. I know it is a bit too early but.. Any ETA for 1.3?
     
  41. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @2dfxman1 - The day/night cycle is governed by two directional lights, a sun and moon object. The sun color changes with the time of day. In automated weather, daylight is dimmed as cloud cover increases. Does this answer your question?

    @SirLancelot - Thanks, I really appreciate it! I really can't give a date as of right now, simply because the last ETA for 1.2 was off by almost 2 weeks :D If you want a ballpark estimate, maybe within 4-5 weeks. I have some Dawn of the Tyrant specifics to work on alongside the 1.3 update, so I can't be sure, but that's what I would guess.
     
  42. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
    I've tried it all, still grey. Reimported etc. Unchecking 'Automate Weather' just disables the sounds for me. Anyone else experiencing this?
     
  43. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @chad - drop me an email or PM, and send me a screenshot or two. I'd be happy to walk through through the issue
     
  44. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I downloaded thhe latest version today after the fix. There is still a camerarain.js in the weather folder. should I delete it. Also getting a few errors :

    Code (csharp):
    1. UnassignedReferenceException: The variable textGO of 'CameraRain' has not been assigned.
    2. You probably need to assign the textGO variable of the CameraRain script in the inspector.
    3. CameraRain.Awake () (at Assets/UniSky/Weather/CameraRain.js:54)
    4.  
    5.  
    6. NullReferenceException
    7. RainCloudLayer.Awake () (at Assets/UniSky/Weather/RainCloudLayer.js:110)
    8.  
    9.  
    10. NullReferenceException: Object reference not set to an instance of an object
    11. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    12. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    13. Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
    14. UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
    15. CameraRain.Update () (at Assets/UniSky/Weather/CameraRain.js:117)
    These are runtime errors only
     
    Last edited: Mar 12, 2011
  45. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    So it looks like I need to read more. :)
    After going to your site I was able to get rid of all the errors but 2 :


    Code (csharp):
    1. Graphics.Blit: material is null
    2. UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    3. RainCloudLayer:Update() (at Assets/UniSky/Weather/RainCloudLayer.js:346)

    If I put a texture in that slot then I get this :

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    3. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    4. Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
    5. UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
    6. CameraRain.Update () (at Assets/UniSky/Weather/CameraRain.js:117)

    And last but not least the raindrops running down the camera look like soap bubbles
     
    Last edited: Mar 12, 2011
  46. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Also as soon as you hit play the moonshader removes the picture of the moon. So I have a white square in the night sky. It does this in the sample scene as well.
     
    Last edited: Mar 12, 2011
  47. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    I'm still having the same issues as grfxman. I do not have these issues (with the exception of a white square for a moon) with the demo scene included with it. Has anyone tried compiling their game with the new version of unisky? It works in the scene viewer in unity, but as a standalone exe I have no sky, just weather and purple bubbles floating on the screen.

    One other issue I'm having is that once the sky hits dusk and goes to night, I have no night time at all, it just returns to a bright gray like its still day time, before the update it would turn black and I would have a star field showing up in between the clouds. My camera is set to black and its doing this in the demo scene too.
     
    Last edited: Mar 12, 2011
  48. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    Does it support dynamic shadows?

    Also, how easy is your system to modify? I mean, is it meant to be modular and easy to add new weathers or do I need to break everything and tinker for days to add a new weather?

    What I'd love to see in new version is less "corroding" clouds and more clouds that actually flow. Because in real life it takes a lot of time for a cloud to form or destroy and it's not visible unless you pay really good attention. In your system they form and destroy themselves way too fast. Doesn't look realistic to me.
     
  49. RoiDanielsen

    RoiDanielsen

    Joined:
    Nov 10, 2010
    Posts:
    130
    @2dfx I think his videos were speed up, or else we would have a hours long video :p
     
  50. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Hmm - the newest version uploaded shouldn't have "camerarain.js" in it. It should be deleted, and will cause errors if it isn't. Try downloading today and see if that new version works. It may be that our newest version just hadn't hit the Asset Store in time for your last download.

    Let me know how that works out.

    @2dfxman - Yes, it uses the normal directional lights so it has all the usual features of a directional light. The code is available, but the weather is pretty interlocked with the system (relies on many other components of UniSky). It wouldn't be "easy" to add other weather effects, but it certainly isn't impossible.

    And yes, the preview video is super sped up so it wouldn't turn out to be super long video. You can set the evolution speed of the weather and the clouds so that it creeps along and is barely noticeable in realtime.