Search Unity

[RELEASED] Enviro - Sky and Weather (Dynamic Sky and Weather System)

Discussion in 'Assets and Asset Store' started by Vondox, Apr 11, 2015.

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I did have an error with the Player (the actual moving Player is a child of the parent object in the scene hierarchy root). But now I've fixed that, and the Enviro Effects do move as the player moves....but they are offset far, far away. It seem like Enviro has trouble when the Player is a child object of a stationary parent. So I have to move the Player parent object to the location I want the Player to be at, and make sure the Player is at 0,0,0 inside the parent, and then it all aligns properly. However, that's not viable in the actual game, since players can save and reload at any location in the map. Is it possible to make Enviro Effects smarter about child Players?
     
  2. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    sounds like the rain might be using local space instead of global by accident. you could look at the scripts yourself =D I'm at work and can't right now.
     
    Vondox likes this.
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Local space -- yes, that was it! Thanks so much!
     
    malkere and Vondox like this.
  4. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Does the switch to world space fixed your issues? It actually should not be a problem to have player and/or camera parented under other objects.
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    yes, switching to world space fixed it, sorry that wasn't clear.
     
  6. SquadraCorse

    SquadraCorse

    Joined:
    May 28, 2014
    Posts:
    13
    Sorry for the late reply, but Enviro does work with PlayWay. Here's a pic of the RTP3 beach scene with PlayWay (beta), Enviro (1.6), and a few other things. It works with 1.7 too but I've got that version of the project all torn apart at the moment. As I understand it PlayWay is about to change developers so you may want to check the forums before buying.

    WeatherTest_2017.04.11_001.jpg
     
    Vondox likes this.
  7. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Update 1.8 was uploaded to store and is pending review!

    Changelog:
    screen_1920x1080_2017-05-24_16-14-15.png

    screen_1920x1080_2017-05-24_16-21-31.png

    screen_1920x1080_2017-05-17_02-52-59.png

    Price will increase to 50$, so grab your copy now!
     
  8. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    That AudioZone component sounds intriguing. Would it be possible to also add a way for it to change which audio file is playing? That would be useful in my case for changing the ambient audio to something else when in a cave versus outside.
     
    Vondox likes this.
  9. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Good idea! I will add a option for this :)
     
  10. SquadraCorse

    SquadraCorse

    Joined:
    May 28, 2014
    Posts:
    13
    Woot - I've been waiting for 1.8 and it looks like you've added everything on my wish list. Thanks!
     
  11. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Looks beautiful!! Thank you for the updates. :)
     
    Vondox likes this.
  12. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    @Vondox any chance you have a patreon ? Truthfully I think the tool deserves more than 50 bucks and since i cannot pay on the store, I'd rather spend on you on patreon. You deserve it :)

    Btw would it be possible to compile a set of tutorials to mess with some of the new settings ? I am trying to specifically create a weather setting where the sky and the environment around you looks a blueish and there's a lot of fog scattering going on.

    Pretty much like this screenshot on a tool I came across.

    http://imgur.com/a/cOckw
     
    Last edited: May 25, 2017
    RonnyDance and malkere like this.
  13. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    +1 for patreon and +1 for your question regarding your screenshot. Would like to have a zone in my terrain or also a whole scene where the weather should be always so dark and foggy like in your screenshot, but anyway with Day / Night Cycle. I am gonna play with Fog and Color Settings for the Weather Prefabs this weekend also to see if I can create something similar.

    Update looks amazing like always. Gonna test it this weekend.
     
    evilangel89 likes this.
  14. NightmarexGR

    NightmarexGR

    Joined:
    Jun 7, 2012
    Posts:
    217
    Time to check for new bugs if any , will report today or next week :p
     
  15. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hehe, I don't have patreon at the moment.

    Will have a look to recreate the mood in your screenshot with enviro later and share settings.

    Planned to add a preset system in 1.9, with scriptable objects. This way I can easily provide different setups.
     
    evilangel89 likes this.
  16. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Contact me with your findings, will try to provide fixes asap :)
     
  17. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey, Thanx for the recent update! I have played around with this for a little while, and just wondering if I can have random weather playing randomly. Kinda like Unistorm does.

    Thanx Again Jim
     
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hi Jim,

    Check the Enviro Zone component on the Enviro Sky prefab.

    upload_2017-5-25_19-44-25.png

    Enviro will try to change weather every "Weather Update Interval" gametime hours. It will check for current season and choosing a matching weather type based on possibily chance.
     
    llJIMBOBll likes this.
  19. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Awesome thank you very much! :D
     
  20. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Hmm I think Patreon takes a cut anyway, how about paypal ? It could be a direct transfer to you and no one will get anything extra and frankly you have no obligation to do anything for us either. It's our way of saying thank you for the best updates ever.

    If you had time to look at setting that lighting for the night, let me know, I am trying to make something similar in my game and it's the color setting I would like the night to look like ^_^b
     
  21. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    I will have a look at it when I am back home.

    Thanks for your support! :)
     
    evilangel89 likes this.
  22. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I was able to recreate an atmosphere which comes pretty close to the screenshot.
    The colors are not perfect and should be darker but well I think with a little bit of fine-tuning we are coming close to a good result. The sun is shining through the fog so you can see the sun disk and you also get some sun flares.Right now only at day you will get this strong "blue fog" effects not during night.

    You find result and settings screenshots here:
    http://imgur.com/a/Rzqff

    The workflow:
    - Create a new Weather Zone
    - Create a new Weather Prefab for this specific zone ("Castle Zone")
    - Play with the settings (See the screenshot) for sun blocking, more density, other colors etc.

    Cheers
    Ronny
     
    Vondox likes this.
  23. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Oooh that's a good place to start I'd say. Btw if you're interested, try out the Screens-space Multiple Scaterring github project for fog along with enviro fog. It's a depth of field effect that works on the fog and you can get classy fog effects with it. Here are some screenshots from the forum thread.

    https://github.com/OCASM/SSMS

    NO FOG


    GLOBAL FOG


    SSMS


    Regards,
    Tharindu
     
    Whippets and Vondox like this.
  24. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Wow didn't not know about this asset. After playing a littlebit the result looks much more amazing. You need to activate the Unity Fog in the Lightning setting though. It was disabled before that and I only was using the enviro one.

    Well only issue now will be to get the fog away from the interiors. Looks pretty funny if you can't see anything in a room because of the fog XD.
     
    Last edited: May 26, 2017
  25. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    How is it with water? So far, I am told only Playway works with Environ and now that asset is in limbo, besides being more than I want to pay for a water that is in limbo, like the previous ones. :)

    I love the fog look above, but prefer to have it less so in near distances and more further away. Does this do that?
     
    Last edited: May 30, 2017
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    I also have checked to recreate this mood at night. But needed to do one little change and use a strong bloom effect.

    For this blue foggy night you want to change the tonemapping settings in sky category to graphes, to be able to control these based on current sun position in sky. High values in night lower values on day.

    I add this in next update ;)

    Here is an example shot:
    screen_1920x1080_2017-05-26_17-19-46.png
     
    Last edited: May 26, 2017
    evilangel89 and one_one like this.
  27. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Sorry for the delay. I will rework the aquas integration script in the next days and add this little tricky plane thing for better fog support. In most cases this should work quite well :)
     
    Last edited: May 26, 2017
    Teila likes this.
  28. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Hey man, if you don't find it too hard, could you try integrating with Aquas Lite as well ?
     
  29. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    @Teila Oh hell yes :D :D Here are some screenshots

    Using a mix of height fog and distance fog to do it. Like I said it's an image effect utilizing better dof on the global fog.

    On a mountain top



    On lower areas of the map

     
    Vondox likes this.
  30. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    @Vondox holy S*** that looks gorgeous! Incidentally, I wanted to calculate bloom intensity and such based on the time of day and such. Do you think I'll be able to do it with the current event setup for a zone ? I didn't try this before asking you, so sorry about that.

    Although, I think the bloom will need to be controlled along with the tonemapping to achieve the effect. Else bloom being intense at the middle of the day can cause players blindness :D haha
     
  31. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Oh, I will add a OnZoneChange Event in 1.8.1. Good point.

    You still can a take a look on new audiozone script. Create duplicate, rename class and add your graphes and gradients for the effects and settings you want to change. Grab the components you want to drive and apply values based on time with something like this:

    Code (CSharp):
    1. float value = someAnimationCurve.Evaluate(EnviroSky.instance.GameTime.solarTime);
    Send me private message if you need help writing this script. :)
     
    Teila and evilangel89 like this.
  32. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    That sounds good. I still didn't look at the new audio zone script. Will do and let you know how it goes! : D
     
  33. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Hello. It seems that sky rendering is done via the second camera and then it blends with the main camera with command buffer. I have a problem with that. It seems like the output of a sky buffer is done in LDR. Is there a way to apply sky buffer in HDR?
     
    Vondox likes this.
  34. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hmm okay, I will check that later and contact you when I found a solution.
     
    Kolyasisan likes this.
  35. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Okay, I have a solution and added a new option to use hdr buffers or not in sky category. Thanks for reporting! :)

    I will send you download information for testing on your side.
     
    Last edited: May 27, 2017
    evilangel89 and Kolyasisan like this.
  36. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Thank you very much! Will definetely look forward to test it.
     
  37. Coalex

    Coalex

    Joined:
    Dec 7, 2016
    Posts:
    11
    We are currently using this for a VR project. In the last version, the clouds would render differently in each eye in any other mode other than legacy. With this new update, legacy mode throws us an error because the cloudcamera is never set.
     
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hi, thanks for reporting, I will add a fix in 1.8.1 :) If you need it very soon, contact me with a private message and I could send you a download when it's done.
     
  39. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Would love to see your images but they are X's for me. :)
     
  40. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    I shall pm them to you then :D
     
    Teila likes this.
  41. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Hello,
    first thanks for the update! Great work, i really like the colors now :). And it also, with the new fog, it works great with playway water now for me!

    I think i found a bug which is related to moon reflections. It occurs when i load the scene, an then changing the Current active weather on the EnviroZone script. In that case form clear to clody1.
    EnviroScreen.jpg
    It only occurs, when sun and moon are both visible, and when clouds are there.

    The second thing i found is, that when the sun is setting, and the moon is visible already, the light reflection is changing instantly to the moon when the system switches to night mode (ambient sound).
    EnviroDayScreen.jpg
    EnviroScreenNight.jpg

    br
    Funkeys
     
    Last edited: May 30, 2017
  42. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hi Funkeys,

    about your first issue: Not seen this before, but maybe the changes in 1.8.1 on clouds could fix this.I will send you a preview of 1.8.1 in the next days, but we maybe have to meet in skype if this still persist in 1.8.1.

    The second one isn't that easy to fix. I think PlayWay uses the brightest directional light and only supports one specular source at the moment.

    So we only could modify the timing when switching the directional light to the moon. Open EnviroSky.cs and search for these lines:

    Code (CSharp):
    1. GameTime.solarTime < 0.5f
    2.  
    3. GameTime.solarTime >= 0.5f
    Change that to maybe 0.4f.
     
  43. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    The new effect cameras are totally messing with my game.. I can't get my background camera to render over anything =o= time for bed... shouldn't setting their depth lower fix it?
     
  44. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Hi Vondox,

    hope 1.8.1 is fixing it! if not, the skype meeting should be no problem if we can do it in the afternoon or on the weekend.

    It is good for me having only the sun as specular source, as long, as it is visible on the horizon, anyway it is the much stronger light source irl. But checking GameTime.solarTime against a specific float value, would fix it only for a specific Lat-Long-Date combination? Is it possible to do raycasting to check when the sun sets behind the horizon?
     
  45. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Okay, have done a few tests and added an optional background rendering feature. It will look like this:

    screen_1920x1080_2017-05-31_17-58-02.png
    Is this the effect you want to achieve?
     
  46. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    The SolarTime is the remapped sun altitude and will work for all lat and longitude settings. So set this to 0.4 should work quite well. Have you tested?
     
  47. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Ok! Thank you, not yet i will do :)
     
  48. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Works perfect! 0.47 is the value for me, having inv ocean at y 0.
     
    Vondox likes this.
  49. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I was tired and grumpy =D
    I have a second camera that renders the horizon which is 3d, not just a sprite. The first camera is set to clear depth only and is set to depth 0, and I had changed your code in older versions to stop it from changing that, instead changing my DistanceCamera I call it. That one is set to use Skybox (Enviro) and is on depth -1. I tried putting the clouds camera and effects camera on -2 and -3, and some other things, but they seem to always block my DistanceCamera...
    I was tired and trying to fix it fast though. Will play with it when I get home, hopefully more fruitfully.
     
  50. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Have just tested a few things and created this simple shader for adding depth information without rendering anything. Working wonderful with Unity Water4 and should work with most other water assets that having issues with enviro fog.

    Here screenshots to compare:

    With:
    screen_1920x1080_2017-06-01_19-32-30.png
    Without:
    screen_1920x1080_2017-06-01_19-32-47.png


    Just create a material with Enviro/Depth shader assigned and add it to a plane or water mesh. Place it slightly below your water level. Would be happy to hear if this worked for you!
     

    Attached Files:

    malkere and Teila like this.