Search Unity

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
    Turns out I installed 1.2 and then it caused an 8.9 earthquake down the road from me >.<. Well was only a 7 something here but... still man these weather effects are crazy! Hehehe Sorry I have to laugh, either that or scream like a little girl and hide in the closet..

    Ok anyways back to the weather. I deleted Unisky from my project, sceen, asset folder etc.. Then I did a search on my C drive for unisky and deleted it from my Temp folder which I think has something to do with builds and from Unity's Asset Store folder so that way it'd actually let me download the new version instead of unpacking the old one which it had in it's cache already. It's still asking for that CameraRain file after I download it again and set it up from scratch. With before mentioned errors. You might want to try and re upload it as version 1.21 or something.
     
  2. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Ok well in the meantime I removed the CameraRain file, followed the instructions and when I hit play I now get

    Graphics.Blit: material is null
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    RainCloudLayer:Awake() (at Assets/UniSky/Weather/RainCloudLayer.js:137)

    If I hit pause it will continue loading the game and everything seems to work just fine. Looks wonderful! Maybe the above error has something to do with one object being loaded before another?

    I should also mention that the sky color seems to be a little messed up. During the day not so bad but probably not correct, when it goes to night its a light gray. I have the clear color set to black so not sure why it's doing this, I don't see the stars texture.
     
    Last edited: Mar 12, 2011
  3. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @rutecht - I sure hope my tool didn't create that earthquake! On a serious note, I hope you and your family are okay, and didn't get much damage

    Thanks for the info, I'm going to try and get a corrected version up on the Asset Store ASAP. It looks like the newest version didn't take hold, I think you're right that we need to upload with a new version number. I will notify the community in this thread when that has been submitted to the Asset Store.
     
    Last edited: Mar 12, 2011
  4. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Version 1.2.1 has been submitted to the Asset Store, so now we just have to wait for it to go live. Keep an eye on the version number :)
     
  5. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Well all seams to work well with the exception of the stars. The download from the asset store worked perfectly. No errors. Only problem is that when the sun sets the sky turns a light gray color with no star texture. Could this be a fog issue? When I look at the atmosphere object during game play the star texture object never receives a texture. If I drag one onto it at night the sky does turn black but I still couldn't make out any stars on my end.

    Im using a Radeon HD 5800.
     
  6. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    I'm on vacation this week so I won't have a dev computer, but I think I have something you can try..

    Look for where the star texture is set to the material, as in material.settexture.. I think its in atmossettings.js. If it is in the awake or start function, try moving it to the update function.

    Let me know If that fixes anything.

    Sorry about these bugs guys, sounds like this might be the last one so we will take care of it quickly.
     
  7. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    I've gotta tell you Chris, I've never felt better about a asset store purchase before as I do with you guys. Great support all around! :)
     
  8. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I agree you guys and Above and Beyond software are my favorites. I am concerned most about having to make terrains a child of Unisky. This is going to wind up being an issue in games with Streaming Terrain Systems like ours.
     
  9. SixTimesNothing

    SixTimesNothing

    Joined:
    Dec 26, 2007
    Posts:
    167
    @grfxman I think the terrains thing is pretty easy to change, there's a script somewhere in UniSky (I don't have it in front of me) that looks for all Terrain components that are a child of the UniSky GameObject, you'd just have to change it to look for all Terrain objects in the scene. You may also possibly need to update the UniSky list of Terrain components as you stream in a new Terrain. UniSky just uses these references to set grass waving (I think – Chris would be able to give you a better answer).
     
  10. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I would love to get a detailed list of thing to change for this. I don't want to accidentally break Unisky. At this point your skies are going to be in everything we make. :)
     
  11. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    How do I get the rain sounds to stop. After the first rain it just continues to play forever. ** It doesn't do this in the editor when I play it, just in the webplayer build. **


    You can see it here


    Also some testers are reporting the world is upside down now:

     
    Last edited: Mar 14, 2011
  12. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    We've had issues with the webplayer before, it seems to be something worth concentrating on in the next patch. Kind of frustrating that the editor and builds can have different outcomes, but I'll look into it. It may be that one of the screen effects needs to have the y coordinates flipped on a specific platform - but this hasn't been shown to be needed in our testing on both Mac and Windows. It may be a bug with Unity's webplayer builds

    As I said before, I'm on vacation this week so support won't be as prompt as usual. I also don't have a development computer - but when I get back next Monday I will spend a good amount of time getting back to everyone and addressing these issues as fast as possible.

    P.S. - Due to some bugs that the Asset Store managers were running into, UniSky has been temporarily removed. We will be working to fix this and get it back up as soon as possible. Seem to have run into an issue on a series of NVidia cards that has broken the tool for some systems. We apologize guys!
     
    Last edited: Mar 14, 2011
  13. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    What time for "Snow"? :)
     
  14. SixTimesNothing

    SixTimesNothing

    Joined:
    Dec 26, 2007
    Posts:
    167
    Good news (unless you're an Xbox developer). The issue that was found with UniSky was due to it being tested on machines with Unity Xbox license installed. Some of the shaders provided as part of the UniSky package will not compile with a Unity Xbox license because the Xbox HLSL shader compiler is more strict than the Cg compiler that is used for most other platforms.

    So in short – UniSky is back up on the Asset Store.

    We will look into providing full Xbox support in a future version of UniSky.
     
  15. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @minevr - snow will be included in version 1.3. I don't have an official date of release but I'm starting on it next week.
     
  16. U2

    U2

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

    Just some ideas...

    In regards to the snow update just a quick request. You put in the water drop shader on the camera lense with the rain and I'm wondering if there is a post frosty glass shader we could have build up during snow events then fade out when not snowing, or connect to the temp request below? Nothing really extreme just a very subtle effect which might be really neat.

    i.e. something like this http://nature.desktopnexus.com/wallpaper/536148/ on the edges of the screen except much much much more subtle and unobtrusive. I guess this could be done by placing a plane in front of the camera too instead of a post effect shader. But I think you probably understand what I'm trying to get at. =)

    Also, in regards to the snow.. I'm not sure how you were thinking of implementing this but I'm wondering if it could be as easy as adding a temperature field to the weather. Then when it'd normally rain/storm instead of being water it'd be snow etc.. This would make it much easier for us to create different climate areas. i.e. I could make a script that as the player raises in height (altitude) I could lower the temp in Unisky and then Unisky would automatically take care of the rest etc.. Or horizontally for north pole vs.. equator etc..

    Take care!
     
    Last edited: Mar 16, 2011
  17. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Those are some great suggestions! I definitely want to write a subtle image effect for snow.

    I'm excited to start working on the snow effects and patch up some minor bugs for the next release. :)
     
  18. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Feature Requests :

    1 Secondary camera slot for eye camera.
    2 Streaming terrain option that checks the scene for currently loaded terrains. ( not parented to UniSky)
    3 downward shader compatibility so shader 2 cards can still see Unisky properly. ( even if they lose some features/quality)

    Thanks
     
  19. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    Expect....
     
  20. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    The more I think about the temperature variable option I think that there are some very exciting possibilities. I mean if you added a variance variable to it then in border areas where the temp is set at 32F sometimes it could rain, sometimes snow.. Using the F scale say if you drop below 0F you could add a sun dog halo to the sun (http://en.wikipedia.org/wiki/Sun_dog). When in the 10-40 angle off the horizon fading to nothing on sunrise. Sun dogs usually are not present during sun set.

    Also, it may have been mentioned earlier and I'm not sure if you were planning on implementing something like this but adding an animated transparent gradient map on the horizon in low temp conditions for simulating the aurora borealis would be awesome to say the least. The gradient could be defined as an array of colors kind of like how it is handled with particle effects. Since aurora can be a host of color variations and it'd leave it open for us to manipulate.
    (http://www.dead-fish.com/Pictures/aurora_venhaus.jpg) as an example for color gradient
    If it could be combined with a clip map of some kind to define shape (i.e. hide parts of the gradient map then you could achieve effects like this..
    (http://www.bestsoftware4download.com/softwareimages/lakwhilk.jpg) This effect could easily placed on the 10 - 40 angle of the moon rise basically as the opposite effect of the sun dog mentioned earlier.

    No matter how it turns out I am excited about any update to this because this single plug-in has the single most impact on increasing the overall intensity and realism to my project beyond my own work. Definitely worth the price!
     
    Last edited: Mar 19, 2011
  21. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    any chance of a C# version?
     
  22. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Hey guys!

    Just got back from a relaxing vacation, so I will be addressing many of the tasks at hand for v1.3 over the next week.

    No c# version planned but if there are a few requests for it I would be happy to work on it.

    - chris
     
    Last edited: Mar 22, 2011
  23. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    I just bought it last night, but would love to see it in C# as well as that is my primary language. I prefer to keep one langauge for a project.

    ty!
     
  24. Don Goddard

    Don Goddard

    Joined:
    Sep 25, 2010
    Posts:
    21
    Version 3.0?! Or do you mean 1.3?
     
  25. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @Don Goddard - Oops! Hehe, yes you're right I meant version 1.3. Just fixed it
     
  26. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Any NFO on why the rain sound FX doesn't shut off after the first storm in the current build for webplayers. I replaced it with the "Wind" sound, But even at a lower volume it's starting to drive me a little Loco. :) It's like constantly being in a wind tunnel.

    Thanks Again
     
  27. helmers

    helmers

    Joined:
    Aug 28, 2010
    Posts:
    48
    Hi,

    after integration im my current project (which was really easy) I have played around with the features (mostly without the weather yet) and stumbled about some problems. Some are definitly a bug (some already mentioned in other posts above) and others are probably user errors from my side.

    1. Is there a way to influence the length of the day?
    Depending on the season / day of year a day should be longer (summer) or shorter (winter) as the night.
    Currently I have found no way to influence this.

    2. Length of dusk/dawn
    It seems to me that there is a linear progrss for the sunrise which starts about 6 to noon.
    I think this is unrealistic. Dusk or Dawn usually take <1h and the rest of the day the sky and the light is quite 'white'.
    What parameters do I have to change to stop the sky from beeing still orange at 11?

    3. Buggy night
    Here several problems arise:
    - the sky is gray or blue at night and the clouds are black???
    - no moon phases
    - moon plops when raching the screen border
    - the starfield texture is not used

    4. In my project the sun rises in the north (top when looking along the Y axis down) and sets in the south.
    I have at least managed to have a non equatorial path by setting the lattitude. But how can I rotate/manipulate the sky so that the sun rises in the correct direction?
    I also tried to rotate my terrain, but Unity does only support translation for terrain.

    5. Really sunny sky I get only when switching off the weather.

    6. I have a lot of trouble setting the ambient light corretly.
    Is there any way within Unisky that sets the ambient light or am I supposed to write my own handler?

    Do not think that I dislike Unisky because of the list above. Alltogether I find it beautiful, fast and like it very much.
    I'm also eager to see what else will be included in the future. Keep up the good work.
     
  28. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    @helmers

    To do this you would need to write a script that changes the speed of time according to your setting / season etc.. Though the ratio of day light hours to night hours is an interesting suggestion for a feature.

    I second the addition of these features as well. Adding a month and year variable would be nice as you could then open the door for moon phases as well as temperature variations per month for the upcoming snow feature.

    I second this feature or changing the sun rotation axis could be set to either x or z. Or better yet based on a direction specified by x,z or -x,z etc.. Shouldn't have to rotate the entire world due to one rotation calculation. An easy way to do this is keep the sun code as is then place it as a child of an empty object. Make the current Unisky script set the sun's local rotation instead of world rottion. Then rotate the parent object's y axis to change where the sun rises and sets. This simplifies the rotations math a bit. Not to mention you could potentially rotate the parent's x as well if you wanted the sun to rise further in the north and set further in the north instead of straight overhead.

    Probably has to do with your settings under clouds. If you turn off weather it will take those settings instead and you have to manually control the cloud cover etc.. If you turn on weather there is a lot more automated looks and less chance for some fairly extreme looks you can get when manually setting things.
     
    Last edited: Mar 28, 2011
  29. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @grfxman - Sorry, I still haven't identified that. It is likely a Unity bug, but I will look into it this week and see if I can find a workaround.

    @helmers - Thanks Rutecht for helping out with answering some of these queries!

    1.) Rutecht covered this well. Writing something like this into UniSky would be a little too specific for a general-purpose tool. The speed of time determines how long each day lasts, and you can control it with a custom script to work with your seasons.

    2.) Under the "Sky" tab, the "Scattering Radius" slider allows you to modulate when the sunset colors kick in. On my system, with a Scattering Radius at the default 45000, the sunrise is complete by 8:30 - 9:00 am.

    3.) If you want moon phases, you can change the moon texture in script between each night. We are planning on implementing a more space efficient method using masks in a future release.

    The moon culling at the edge of the screen is a bug, and something that will be addresses by the next release.

    The sky colors at night and no starfield texture sounds like a bug as well - can you email a screenshot with your system specs? This would be very helpful so I can address it in the next update.

    4.) Rutecht covered this, but there is a very easy way to change the direction the sun rises/sets in.

    In the Sun's script, in its Update() function, at the end of the function below the system time update and position setting, you can rotate the entire system with:

    transform.eulerAngles += new Vector3(0,100,0);

    Where the Y component rotates the system.

    5.) Can you elaborate more on this? It is true if the weather system is turned off, the cloud over doesn't modulate - this is so that you can setup your own custom weather scripts.

    6.) There is some leftover code that automates the ambient color levels and you can refer to it to write your own system for the ambient light. Check the commented code at the bottom of the Update() function in the sun script.

    Code (csharp):
    1. // Ambient light
    2. //  var ambientColor : float = (-1 * transform.TransformDirection(Vector3.forward).y)/4f;
    3.     // clamps between (night) and (day)
    4. //  ambientColor = Mathf.Clamp(ambientColor, 0.3, 0.8); // 0.2, 0.5 - Increased these as everything seemed really dark (SM)
    5. //  RenderSettings.ambientLight = new Color(ambientColor, ambientColor, ambientColor, ambientColor);

    Let me know if you have any further questions, I'll be happy to go into further detail with anything you are wondering about :)
     
  30. Gerwald

    Gerwald

    Joined:
    Jan 13, 2011
    Posts:
    8
    Love the work... It is on top of my wishlist

    What i wuz wondering...
    I laughed when i saw that the light followed system time... Really... Really nice...
    In the same line of thinking:
    What about the weather? The amount of apps online wich give regional weather info.. could it connect to that stream of data... ?

    And now.. back to dreaming..

    Relly really nice work.
     
  31. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @Gerwald - Thanks very much for the kind words!

    UniSky isn't set up to work with real regional weather info "out-of-the-box", but I don't imagine it would be very hard to do if you needed it in your application. You would just need to translate the real weather attributes into something UniSky can use - such as cloud cover, precipitation level, and chance of rain. It would require a bit of scripting into the UniSky system, but would be pretty cool (would make a good screensaver or "7-day forecast" simulator)
     
  32. Gerwald

    Gerwald

    Joined:
    Jan 13, 2011
    Posts:
    8
    Yea.. imagine you play oblivion.. at night... and you suddenly realize it is raining... just like in your game...
    Now that would cause some sleeping difficulties... you won`t go to bed... Real time sound effects..


    <homer> hmmm Donut </homer>
     
  33. Sol Elite Design

    Sol Elite Design

    Joined:
    Apr 1, 2011
    Posts:
    2
    I purchased this recently. I plan on using it in the desktop and web versions of my current project. I was playing around with it on an iPhone deployment and stats are saying the frame rate is around 17 FPS. I haven't actually deployed to iPhone/iPad because I'm getting my Apple developer subscription back online now.

    Am I doing something wrong? Will Unisky run on iOS on any level? Is there a way to disable the weather feature entirely get better FPS? Other optimizations?

    Great work by the way. This is quite a nice feature even if it doesn't run on iOS.

    Thank you,

    Kevin
     
  34. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    my vote on this
     
  35. houndie

    houndie

    Joined:
    Nov 25, 2010
    Posts:
    146
    A C# version would actually be quite nice to have.
     
  36. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @Sol Elite Design - UniSky wasn't designed for iOS, and actually wasn't even tested on it. If it actually does run, just at low FPS, then I'm sure there are some features you could trim off that would increase the FPS. E-mail me if you need this for an iOS project and I'll be happy to help with this.

    @arioch82 Houndie - 'nough said. I'll release a v1.22 that will include both a JS and a C# version of UniSky as well as a few minor bug fixes - likely within the next week. I'll be sure to announce it when I do.
     
  37. houndie

    houndie

    Joined:
    Nov 25, 2010
    Posts:
    146
    Hey Chris,

    Just sent you a couple PM's having 2 wierd issues.

    Thanks
     
  38. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Ok I've had enough people test Rogue at this point to know that the Unisky issue is NOT a shader 2 or Shader 3 issue. Several new Nvidia cards with full compatibility came in upside down. I remember this happening once before in Unity when the car demo came out. It was upside down until I tracked down a correction on the forum. This seems like the same issue.

    To make it weirder one of the trees in the default assets (Think its called big tree ) actually blows in the wind on our webplayer build. I have several questions at this point and will send you an email later today.
     
  39. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @grfxman - hmm... I'm guessing the upside down thing can be narrowed down to one of the two image effects. Weird thing is we've tested this on NVidia and ATI without issues, so this must be a specific line of cards that is doing this.


    Just finished the C# port today guys, and will be submitting to the Asset Store soon - one thing though: In JS I had access to the WindZone class through script - in C# I can not get access (WindZone scripting is undocumented and therefore not technically supported). Not sure why Unity hasn't given us open access to this class, but it looks like the C# version won't have the automated wind on the trees :\
     
  40. houndie

    houndie

    Joined:
    Nov 25, 2010
    Posts:
    146
    Cool thanks Chris, yea not sure why they did that with some of the classes, its like a big step backwards. Hopefully they will change that.
     
  41. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I emailed them and they said we should put exposing wind on the requested features site. I've never actually done this and don't even know how but would vote for it.

    Even though I don't believe fixing errors is a feature request :)
     
  42. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Version 1.2.3 when it hits the Asset Store - should be within next few days:

    1.) A fully C# version of UniSky, as well as the original JS version
    2.) Shader bug fix (occurred only on a certain class of cards)
    3.) Fixed moon culling at edge of screen and faulty rotation with camera
    4.) Fixed Lightning Prefab bug with the character controller
     
  43. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Version 1.2.3 is now live on the asset store :)
     
  44. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    Would be possible to somehow increase quality of clouds? I mean make color gradient more fluent.
     
  45. damsku

    damsku

    Joined:
    Mar 10, 2011
    Posts:
    17
    Hey Chris,

    Excellent work !
    I was wondering what kind of fog are you using. Is it the stock Unity fog or did you make your own?
    I'm making some weather stuff too and I need some depth/height fog so I added my own, but I am using deferred rendering and I never get access to the final pixel color in the surface shaders, so I'm doing it in a fullscreen pass reconstructing the pixel world position from depth, however this also has issues with translucent objects.
    I was wondering how did you approach the problem (if you did your own version of the fog that is :))?
    Cheers
     
  46. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Bump to remind you how much we are looking forward to cold weather effects ;-) wink wink
     
  47. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    @damsku - the fog used in UniSky is the built-in fog. I haven't spent a lot of time with surface shaders (I always end up writing them the "old school" way) but just off the top of my head, maybe this would work?

    1.) Get the vertex world position through the input structure
    2.) Pass the camera position to the shader
    3.) Manually calculate your depth
    4.) Modulate the color accordingly, ignoring transparent coordinates

    @rutecht - Hehe, I'm doing all I can to get to that. There is a mobile version of UniSky coming out in the next week or so, and the update after that will definitely be the snow effects.
     
  48. damsku

    damsku

    Joined:
    Mar 10, 2011
    Posts:
    17
    Chris: that's how you could do it in forward, however with the deferred rendering, you write Albedo, Emission etc.. but you never get access to the final color after lighting so that wouldn't be the best place to perform the fog.
    I think I should be able to make my fullscreen fog pass just before rendering the translucent objects with some RenderObject() and render queue magic, then I could fog the transparent objects with the vertex/pixel shader since those are forward anyway.
    Let's see how that goes :)
     
  49. ognjenm

    ognjenm

    Joined:
    May 3, 2011
    Posts:
    97
  50. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Chris I just updated Rogue's Odyssey to the current Unisky. Before I put it on FaceBook I would like to know the proper setting to just get it to rain once ever day or two. More Importantly how to get the rain sound effects to stop afterwards. I am still getting the sounds after the first rainfall.

    Also if you use Skype my name on it is : grfxman1

    I have a few other questions about further MMO Integration.