Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

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

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

  1. RealistikDash

    RealistikDash

    Joined:
    Aug 31, 2018
    Posts:
    4
    Hi there! I am having issues with Enviro Sky. While using UFPS and Enviro, I noticed the weapon is not shown while Enviro Effects are on and set up. Thank you for your time.
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, please try to create a new layer for the moon and assign this in EnviroSky -> Rendering Setup -> Moon Layer. Please also check your weapons layer setup on your camera, make sure that they are in culling mask.
     
    P_Jong likes this.
  3. RealistikDash

    RealistikDash

    Joined:
    Aug 31, 2018
    Posts:
    4
    Thanks! It worked.
     
    P_Jong likes this.
  4. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    Hi @Vondox,

    I recently noticed a compatibility issue between Enviro and an ocean system called Hydroform. Both assets were fully compatible up to some time in March, when it appears that an updated Enviro version began masking Hydroform's oceans from extending all the way to the horizon.

    Here's more info: https://forum.unity.com/threads/hydroform-ocean-renderer-released.385545/page-15#post-3782221

    And here's a screenshot:

    Unity 2018.2.5f1 Hydroform and Enviro - DX11_ 2018-10-13 21.15.08.jpg

    This looks like a potential draw-order or z-buffer issue of some sort. I was wondering if you know what might have changed that could possibly be causing this.
     
  5. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hi, please try to change the render queue of Hydroform to transparent (3000+).
     
  6. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    53
    hi @Vondox
    make an update for the interaction with mirror or is there a tutorial to?
     
  7. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    145
    Hi in my game I have 17 Level scenes which all use enviro for lighting. And 1 persistent master scene which contains the Camera and UI.
    Is there any problem with each Level scene having a different instance of the enviro prefab and master camera be assigned each time upon loading a Level scene?
     
  8. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    I just modified Hydroform's ocean surface shader to use both a Queue and RenderType of "Transparent", but neither change solved the masked-horizons issue. I also imported a few earlier copies of Hydroform into my test project, and it has been using a queue of "AlphaTest" and a renderType of "Opaque" since it's original release. I don't have any older packaged versions of Enviro at hand, but am open to any other suggestions you have.

    Code (CSharp):
    1.  
    2. SubShader
    3.     {
    4.         Tags { "Queue" = "Transparent"
    5.                "RenderType" = "Transparent"
    6.                "ForceNoShadowCasting" = "true"
    7.                }
     
  9. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hi, I will finish mirror integration tomorrow and send it to you too.
     
    nirvanajie and Stefan86 like this.
  10. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hi, should be no problem, but not really tested this yet. Please contact me if you run into issues.
     
    VictorKs likes this.
  11. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hm strange. Enviro posteffects will be executed with "ImageEffectOpaque" tag. So only should work with material that rendering in these queues and taht should write to camera depth texture. In your screenshot it looks like that the ocean material rendered in opaque queue but not writing to depth so it will be get overriden by fog post effect.

    Could you please check if Hydroform is setting the material render queue in runtime somewhere?
     
  12. TheStrongSkye

    TheStrongSkye

    Joined:
    Oct 29, 2016
    Posts:
    23
    How to make clouds like that on the screenshots? Even on Ultra quality they aren't as good as on that screenshots
    Any help?
     
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hm, sorry not sure what settings I used for the screenshots, but you can get the identical look of course. SO just take a look into cloud settings and tweak them.Oh please note that I also used the free Unity Post Effect Stack (Color Grading and Bloom)! That one will make a big difference too.
     
  14. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    53
    Super... Many Thanks
     
  15. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    90
    Hi I would like to set up the weather to cycle through a preset list. I added them in order to the weather presets but I then read in the documentation that they are selected at random depending on the season. Is there a way to have the weather go through the list in order? or would it be simpler for me to code it into my game manually?
    Enviro.PNG
    Thanks
    Matt
     
    Dwight_Everhart likes this.
  16. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, yea you would need to write a simple script for that. Deactivate auto weather update in "EnviroSky" -> "Weather Controls" and create a new script. You can simply change weather with following code:

    EnviroSky.instance.ChangeWeather(0); //uses the id from your list or:
    EnviroSky.instance.ChangeWeather("Cloudy 1"); //uses the weather preset name
     
  17. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    90
    Thanks, I have coded this in now and its all working as expected.
     
    Vondox likes this.
  18. bob7777

    bob7777

    Joined:
    Sep 12, 2018
    Posts:
    6
    Work this mit VR (Rift ) realy ?
     
  19. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Yea, it works with oculus rift in single and multipass. :)
     
  20. yinono

    yinono

    Joined:
    Sep 15, 2010
    Posts:
    26
    I bought this assets, and it looks great.
    How ever I need to render multiple cameras in my project and Enviro has settings just for one camera.
    How can I use this on multiple cameras?

    Thanks
    Yinon
     
  21. DevS0L0

    DevS0L0

    Joined:
    Feb 10, 2017
    Posts:
    12
    Is there support for audio at different times of day? For example, loons at 7.30 to 12.00? I'm interested in this sky system and if Enviro doesn't have this, I'll just code a system. Thanks :)
     
    Vondox likes this.
  22. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Right now not. I also suggested Random Sounds for different EnviroZones or normal Weather prefabs. You only can define random Thunder sounds at the moment. As I know Hendrik added it to the Todo list.
    Right now you can only add sound for day and night not for specific hours. Cool suggestion if you ask me.

    Cheers
    Ronny
     
    DevS0L0 and Vondox like this.
  23. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, please take a look in component menu -> Enviro. There is a "AdditionalCamera" component that can be added to other cameras.
     
  24. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Yeah, you would need to code it yourself right now. But I like your idea and add something like that in one of the next updates. :)
     
    TheStrongSkye and DevS0L0 like this.
  25. TheStrongSkye

    TheStrongSkye

    Joined:
    Oct 29, 2016
    Posts:
    23
    I have a problem with an ambient lightning - it's not updating
    The ambiet color at night and at day i the same
    Enviro version 2.0.3
    Someone know how to fix this ?
     
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, please update enviro to latest first. What ambient mode do you use? Please mkae sure that you set the ambient mode directly in EnviroSky -> Edit Profile -> Lighting category.
     
  27. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Is the location and time supposed to yield reasonably accurate results? I have set my lat/long to northern England, and day 172, which is midsummer. Problem is that the sun never sets; it arcs lower, but not below the horizon. This is with the progress time set to none. If I select System Time, for time of writing, for instance, which is 23.02 BST, then the Enviro sky is night. Which at least is correct. I may have misunderstood what's happening here, but I want to try to get close to the sun position from whatever lat/long, and time of day and year.
     
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, please send me lat/long of your location. It should reasonably accurate.
     
  29. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Hi - the lat/long is 55N 2.35W. Thanks.
     
  30. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, okay I checked that location with realworld sun rise and set times data and came to the conclusion that its reasonably accurate in enviro.

    upload_2018-10-21_13-36-53.png

    As you see the suns altitude in night is only -11° max. Also sun rise and set times are correct for me.

    upload_2018-10-21_13-41-9.png
    upload_2018-10-21_13-48-7.png

    If you think that night sky should be darker in enviro you may want to modify the sky settings. (Please try to lowering the "Sky Luminence" curve left half.)

    upload_2018-10-21_13-48-59.png
    (Same time but with modified "Sky Luminence" curve)
     
    P_Jong likes this.
  31. Crembo

    Crembo

    Joined:
    Jun 2, 2014
    Posts:
    16
    More WIP. Did I ridiculously overdo the atmospherics to get a nicer screenshot? Yes. Am I sorry? Nope.
    Screenshot 2018-10-22 11.35.22.png
     
  32. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    173
    I am using "EnviroSky.lightSettings.ambientIntensity.keys[0].value = 2f" to modify the value of "Amibient Intensity". It doesn't work. How should I change it?
     
  33. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    17
    How to save simulated time?
     
  34. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, there will be a new variable to modify ambient light intensity for "skybox" ambient mode in next update that can be used in runtime per script or with the InteriorZone component.

    For now you could delete the line in EnviroSky.cs that sets ambient light intensity and control that yourself. Please feel free to contact me in private chat if you need help with that.
     
  35. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, you can use the EnviroSky.instance.Save(); and EnviroSky.instance.Load(); function to save/load time and current weather. Those using the Unity "PlayerPrefs". If you use a third party save system like "EasySave" I also could help you implement saving enviro variables.
     
  36. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Thanks for checking. It wasn't as subtle as the darkness of the night sky, but the sun was up at midnight, so something got messed up somewhere. But, I will try again, and maybe see if I can pin down what it was I did.
     
  37. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    75
    I have a script that initialises various setting of my scene at the start of the game, and I want it to set the Enviro weather. However, when I use EnviroSky.instance.SetWeatherOverwrite(weatherID) in the Start of that script, the weather setting then gets overridden shortly after and replaced with the Envirosky start weather preset... Any suggestions on how to manually set that initial weather without it being overriden immediately after?
     
  38. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    17
    I saw that. Where is the best place to call Load ()?
     
    Last edited: Oct 24, 2018
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, put your code into a coroutine and wait a frame to execute it. Something like that:

    Code (CSharp):
    1.     void Start ()
    2.     {
    3.         StartCoroutine(ChangeWeather());
    4.     }
    5.  
    6.     IEnumerator ChangeWeather()
    7.     {
    8.         yield return 0;
    9.         EnviroSky.instance.SetWeatherOverwrite(1);
    10.     }
     
    StevanJay likes this.
  40. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    You could load you time and weather in a coroutine like the post above. Oh if hours/minutes and seconds won't load correctly you may have to change this line:

    internalHour = PlayerPrefs.GetFloat ("Time_Hours");
    to;
    SetInternalTimeOfDay(PlayerPrefs.GetFloat("Time_Hours"));
    in Load() function in EnviroSky.cs.

    I will fix that in next update of course.
     
  41. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    53
    Hey @Vondox..
    I want to save enviro weather in a database .. I use uSurvival and try to save and load it there without success ..
     
  42. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Sorry, don't have uSurvival. At the end you just need to save a float for Time of day, and three integer for days,years and current weather id. I don't know what database uSurvival uses and how it communicates but you most likely need to create those four fields in your database once, then send and read back the values with the database interface code from uSurvival.
     
  43. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    53
    Ok.. I will try it..
    Thanks
     
  44. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    442
    hi @Vondox : I have another strange behaviour:
    in 2017.4.13f1 everything works fine:
    in 2018.2.12f1 I have this issue:
    this is my set:

    and when I use this code:
    Code (CSharp):
    1.  
    2. var weather = sky.Weather.weatherPresets[0];
    3. for (int i = 0; i < sky.Weather.weatherPresets.Count; i++)
    4. {
    5.     if (sky.Weather.weatherPresets[i].Name.ToLower().StartsWith("grally - " + name.ToLower()))
    6.     {
    7.         weather = sky.Weather.weatherPresets[i];
    8.         _weatherId = i;
    9.         break;
    10.     }
    11. }
    12.  
    I get 0 weatherPresets... is there some issue on 2018? thanks in advance
     
  45. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    17

    I call it in the coroutine, so I did the right thing. If you call it immediately, the weather is not loaded in the coroutine-everything is fine. Offer correction to do so: when choosing the simulation time, though, a check appears, to save time and upload or no. Of Affairs in a few lines, but many will be =)

    Thanks for the great assets.
     
  46. DrussAxeLegend

    DrussAxeLegend

    Joined:
    May 4, 2017
    Posts:
    6
    Hello, could you please also be able to send me the mirror integration when its completed.
     
  47. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Hello, sorry not sure why it work in 2017 and not in 2018... I don't know of any issues in UNity 2018 with enviro. When do you call this method?
     
  48. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    442
    I call into an 'awake' monobehaviour (like the 2017)
     
  49. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    1,895
    Please try to put your code into a coroutine like I showed a few posts above. Maybe the script execution order messed up here so weatherPresets list isn't populated yet.
     
    ghiboz likes this.
  50. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    442
    now seems ok...
    I have another issue but I think is relative to the 2018 core..
    I need to deactivate enviro.. and I use `SetActive(false);` but I get an error

    NullReferenceException: Object reference not set to an instance of an object
    EnviroSky.UpdateWeather () (at Assets/3rdParties/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:2572)
    EnviroSky.Update () (at Assets/3rdParties/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1554)
    I think that depends that the code I disable the component but something is still active...