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

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

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

  1. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, please make sure that you have latest version of Enviro. Then check the Enviro - Sky and Weather folder -> Documentation.pdf. Follow the steps for LWRP/URP setup here. :)
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello,

    sorry I forgot to add the HDR and QualitySettings part in EnviroSky Manager yet. I will add these for next update. But you can access sun and moon shafts with this:

    EnviroSkyMgr.instance.useMoonShafts
    EnviroSkyMgr.instance.useSunShafts

    Don't you use Enviro Lite for low end simple setting? So EnviroSky.instance.ApplyVolumeCloudsQualityPreset(0); is not needed then.

    Also if you know that Enviro Lite will be used in your simple settings you also just could use EnviroSkyLite.instance to set those settings.

    Best Regards,
    Hendrik
     
  3. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    Thanks Hendrik!

    I am using Enviro Lite for Smartphones. And want to have additional Settings for old Smartphones or old Laptops to have it "even simpler"...
     
  4. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    Hi, I have recently upgraded to the latest version (2.2.1a) and re-created my enviro instance using the enviro manager.

    I was able to set everything perfectly when unity was set to target android. But when I then switched to Universal Windows Platform for some reason the enviro instance stop recognising the weather presets. (it thought there was 0 in the list)

    I decided to create the instance from scratch to avoid any confusion but then found that the option to create instances are not available. I have attached screenshots of the options available when targeting android and the missing options when targeting Universal Windows Platform.

    I took a look at the editor code and I think the issue may be down to how you have defined the ENVIRO_HD and ENVIRO_LW settings. In the screenshot you can see that both of them are greyed out (this is when I am targeting Universal Windows Platform) I couldn't find the definitions for these conditional compilation constants but I'm guessing they included the different build platforms and windows universal is missing?

    thanks
    Matt
     

    Attached Files:

  5. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi Matt,

    sounds like that the scripting defines symbols for UWP are missing here.

    Please open your Project Settings -> Player and click on button to show your UWP settings.
    upload_2020-1-13_14-34-6.png

    Then scroll down to "Scripting Define Symbols" and add ENVIRO_HD and ENVIRO_LW.
    upload_2020-1-13_14-34-49.png

    That's all and should fix your issue.
     
  6. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    Hi thanks for the quick response. Yeah that was it! Added them in and its working now
     
    Vondox likes this.
  7. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    45
    Hey I've run into a problem where Enviro's sky isn't displaying in the right eye of a VR headset. I'm using Unity URP 2019.3.05f and Enviro 2.2.1. VR is set to single-pass instanced. I'm fairly certain I've set up the scene properly. Any idea what could be causing the problem?
     
  8. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, singlepass-instanced isn't completly supported yet. Please try the standard single pass mode and check if "Single Pass" is enabled in Enviro Sky Instance -> Rendering Setup settings. Otherwise I need to check as Unity 2019.3 with URP is very fresh and maybe some changes broke something.
     
  9. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    45
    Ah ok, thanks.
    So Unity's new way of integration VR is through their XR Plugin Management package which has only an option for multi-pass & single-pass instanced. Multi-pass doesn't seem to be working as well though.
    Might you know of an alternative way to get it working with single-pass instanced?
     
  10. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Yeah, I already started working on that one for Enviro 2.2.2 update. I may can send you an update for enviro in the next days. Otherwise you may need to switch back to the old XR method by removing the XR Plugin package.
     
  11. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    45
    great! thanks. If you could send it then that'd be amazing.
     
  12. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    Hi, I have found some strange behaviour when I come to try and change the current weather mode.

    I am using an EnviroSky Lite for Mobiles instance and have a number of presets selected in the Weather Configs section (See screenshot).

    I can then access these in code by using the following api call in code

    Code (CSharp):
    1. EnviroSkyLite.instance.Weather.weatherPresets
    I them then get the name of the preset and call the following method

    Code (CSharp):
    1.  EnviroSkyLite.instance.ChangeWeather(nameOfWeather);
    However, I noticed that sometimes the weather doesnt actually change. I took a look at the ChangeWeather method in EnviroCore.cs and noticed that it takes the name and then does a lookup on its own list of presets.

    Code (CSharp):
    1.  public void ChangeWeather(string weatherName)
    2.     {
    3.         for (int i = 0; i < Weather.WeatherPrefabs.Count; i++)
    4.         {
    5.             if (Weather.WeatherPrefabs[i].weatherPreset.Name == weatherName && Weather.WeatherPrefabs[i] != Weather.currentActiveWeatherPrefab)
    6.             {
    7.                 ChangeWeather(i);
    8.                 EnviroSkyMgr.instance.NotifyZoneWeatherChanged(Weather.WeatherPrefabs[i].weatherPreset, Weather.currentActiveZone);
    9.             }
    10.         }
    11.     }
    This list of presets is different though to what I have set in the inspector. It also only seems to include the standard presets and none of the LQ ones. (See screenshot)

    As such it skips over setting the weather.

    How can I set the weather presets in EnviroCore.cs to be the same as what I have in the inspector?

    Thanks
    Matt
     

    Attached Files:

  13. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    Think I may have answered my own question. If I stripped off the "LQ" from the end of the weather name before calling ChangeWeather then it would find a match on the weatherPreset.Name. On a separate note I noticed that If I use the standard storm preset while using the EnvioSky Lite Mobile instance the rain and subsequent splashed on the terrain all render as black. I take it the full blown presets are not advised for the Lite Mobile version. I should just stick to the LQ presets?
     
  14. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, ah yeah I see. It is because the name field of the weather presets need to be unique and both the LQ and non LQ ones using same names. So just change them in each weather preset and list should be include all.

    I need to check why the storm rain renders black in mobile instance.
     
  15. karonte

    karonte

    Joined:
    Jun 2, 2013
    Posts:
    48
    good morning. does it support HDRP in 2019 ?
    thanks
     
  16. MianWaqqas

    MianWaqqas

    Joined:
    Sep 21, 2017
    Posts:
    22
    Issues:Version 2.2.0a
    1. Enviro scripting define symbols missing for ios platform. Due to that options to create instances in enviroskymgr (editor) not showing.which only shows when switched to android or pc,mac platform. After spending 3 days finally resolve it. i manually add ENVIRO_LW;ENVIRO_HD in player settings.
    2. Sun disappear when "dont destroy on load" enabled. and assign player and camera runtime with ChangeFocus method.
     
  17. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, HDRP support is work in progress, but can be tested on enviro discord channel.
     
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello,

    1.) Next update will include new buttons to add the scripting defines when missing for current active build target.
    2.) Please test and use "AssignAndStart function instead of ChangeFocus.
     
  19. MianWaqqas

    MianWaqqas

    Joined:
    Sep 21, 2017
    Posts:
    22
    i use assignAndstart method in scene 1.
    and then call changefocus method in scene 2.
     
  20. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Please try and use AssignAndStart on second scene too. I forgot a check for the camera in ChangeFocus function where it tries to remove the enviro component from old camera. Will be fixed in 2.2.2.
     
  21. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Microsplat + Enviro + Aquas. Terrain created with World Creator Standalone PRO + GAEA PRO. Textures are from Gametextures.

    Image 0.jpg is a reference taken from World Creator.
     

    Attached Files:

    • 0.jpg
      0.jpg
      File size:
      692.3 KB
      Views:
      475
    • 1.jpg
      1.jpg
      File size:
      486.3 KB
      Views:
      507
    • 2.jpg
      2.jpg
      File size:
      234.4 KB
      Views:
      483
    • 3.jpg
      3.jpg
      File size:
      162.8 KB
      Views:
      483
    Vondox and Bartolomeus755 like this.
  22. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    29
    Hello. There was such a question, I don’t know maybe they asked him already, but I did not find:
    In "Environmental Lighting" there is "Ambient color", by default "Source" is set to "Color". This works well with the forest and so on, essentially with everything above the surface. But what about under the surface? Just when there is a cave or bunker, it is light there, although it should be dark. If you transfer "Source" to "Skybox" then everything is ok. But you need a "Color".
     
    Last edited: Jan 19, 2020
  23. AhmadMcreator

    AhmadMcreator

    Joined:
    Nov 20, 2019
    Posts:
    24
    hello I am having the same issue with an asset I bought (directX 11 grass) so I was wondering if the issue was solved?
     
  24. Andrewleek

    Andrewleek

    Joined:
    Jul 31, 2017
    Posts:
    5
    Hello Vondox. Thank you for this wonderful asset.

    Unfortunately I've run into an issue regarding forward rendering and and the need for a depth texture. Im using Lux water with Enviro and I need to use a depth texture for the planar reflections to work but it appears that unless i have sun/moon shafts enabled I cannot see anything. Ive narrowed it down to line 81 in EnviroPostProcessing.cs:

    if (EnviroSkyMgr.instance == null || !EnviroSkyMgr.instance.IsAvailable() || (EnviroSkyMgr.instance.useSunShafts == false && EnviroSkyMgr.instance.useMoonShafts == false))

    ... now if i change this to:

    if (EnviroSkyMgr.instance == null || !EnviroSkyMgr.instance.IsAvailable())

    Everything works as I want and i don't need to enable sun/moon shafts, but Im not sure if this is something i should be doing. I don't want to fix one thing and break another. Can you please advise or perhaps explain the logic here?

    Thank you!
     
  25. tractionsim

    tractionsim

    Joined:
    Aug 4, 2019
    Posts:
    3
    Found issue that prevents season from changing through the API.

    public void ChangeSeason(EnviroSeasons.Seasons season)
    {
    if (Seasons.lastSeason != season)
    {
    EnviroSkyMgr.instance.NotifySeasonChanged(season);
    Seasons.lastSeason = Seasons.currentSeasons;
    Seasons.currentSeasons = season;
    }
    }

    if (Seasons.lastSeason != season)

    should probably be

    if (Seasons.currentSeasons != season)

    (we are no-oping if new target season is the same as the current one, and not the previous one)
     
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, maybe check out the EnviroInterior component. That can be used to smoothly fade between different lighting, fog, ambient sound and so on.

    Just create a new object and add the component. Now you can add triggers to your cave/bunker entries and enable the features you want to change if player enters/exits.
     
  27. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, unfortunaly nothing I can really do from my side. Enviro currently uses Unity direcitonal light cookies for cloud shadows. So if another asset does not work well with this Unity feature it may has to be modified to work with or you need to disable the cloud shadows for now. It's already planned to move cloud shadows to a screenspace effect in future. But no eta for that one yet.
     
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, do you maybe use Unity Post Processing in your scene? If yes: Please check your camera -> Post Processing Layer component. Make sure that "Directly to Camera Target" option is disabled.
    Otherwise you just can deactivate the Enviro Post Processing component on your camera if you don't want to use light shafts at all.
     
  29. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, thanks for your report! Yeah that does make more sense, great find. :) I changed it for next update.
     
    tractionsim likes this.
  30. Andrewleek

    Andrewleek

    Joined:
    Jul 31, 2017
    Posts:
    5
    It looks like that option is only visible in 2019, i am on 2018 and so could not see it... However if i switch the inspector to Debug mode i am able to see the option (although is labeled "Final Blit To Camera Target") and this is apparently on by default. Although turning it off makes no difference.

    In the code block i referred to above you have this:

    Code (CSharp):
    1. // Disable Depth Rendering in Forward. Possible problems with other effects not reanble this every frame!
    2. if (cam.actualRenderingPath == RenderingPath.Forward)
    3. {
    4. if(cam.depthTextureMode == DepthTextureMode.Depth)
    5. cam.depthTextureMode = DepthTextureMode.None;
    6. }
    7. return;
    Which shows that you are killing the depth texture if it is enabled.

    The camera also has the LuxWater_CameraDepthMode.cs script on it which has this:

    Code (CSharp):
    1. void OnEnable(){
    2.         //    Get main Camera and make sure it renders into a depth texture
    3.             cam = GetComponent<Camera>();
    4.             cam.depthTextureMode |= DepthTextureMode.Depth;
    And if i toggle that script on it does indeed show the water for a moment before disappearing which would make sense as it enables a depth texture before the Enviro Post Processing script kills it.

    I thought your post processing script did more than just light shafts, but if that is all it does then the simplest option is to just disable the script. Perhaps it would be better to only enable the Enviro Post Processing script if light shafts are enabled.

    Perhaps this post will help others if they run into a related issue.

    In any case thank you for getting back to me and helping me understand this issue. For now I will simply disable the script unless I want light shafts.
     
  31. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, thanks for your report. Oh that is quite old workaround code here and most likely not needed anymore. I will check and remove it for next update.
     
  32. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    29
    Thank you very much, has worked.
     
    Last edited: Jan 20, 2020
  33. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Wow this system looks great, very interested in purchasing, I am worried about performance so is there an option to bake the sky color and clouds to a skybox and be able to use that so as to have no overhead, just would like to have a time of day and weather at game startup, don't really need for clouds to animate or the lighting to change after that. If so is also possible to just have the sky color rendered to the skybox and then have the option to have the clouds over that?
     
  34. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, please visit my discord channel. I am working on an asset that includes exactly what you are looking for and even more. ;) Currently looking for testers!

    https://discord.gg/5c6kfW6
     
  35. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    29
    Good afternoon. How to change the value to "Skybox" in the "Source" block in "Environmental Lighting". Just now automatically changes to "Color". You can stretch the trigger to the whole world =)
     
  36. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, you can set that in your Enviro Sky Instance -> Edit Profile -> Lighting category -> Ambient Light Mode.
     
  37. the3dhermit

    the3dhermit

    Joined:
    Mar 25, 2014
    Posts:
    10
    Hi. Sorry mb I'm missing something, but I dont understend, this asset suppurts HDRP or not?
     
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, HDRP not yet supported in asset store version. But feel free to join beta in Enviro discord channel and have a first look into hdrp support for Enviro.

    https://discord.gg/5c6kfW6
     
  39. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    29
    That I'm blind. Thank you very much!
     
  40. spso

    spso

    Joined:
    Oct 11, 2017
    Posts:
    17
    Hi Vondox and all,

    first of all, as a long time Enviro user I have to say: Fantastic Work man! Your solution is in my opinion by far the best when it comes to it's moods, colors and ease of use.

    What I have recently discovered (and I have a feeling this is since the 2.0 update) is a quite high base pressure on the GPU if using Enviro. My question would be: What could I do to mitigate that issue? How do I get a better performance?

    We are usually only using a day environment and no time progression but would love to have: Fog, Flat clouds and volume Clouds.

    We are always using a VR environment (HTC Vive and Index). Till now also the standard render pipeline of Unity and also 2018.4 LTS. GPU's are 1080Ti or 2080 Ti

    About the issue: If you have a look at the screenshots attached you can see that:
    All Features are switched off except the ones written.

    Enviro_VolumeClouds_Off_Flat_AndFog_Only.JPG
    Enviro On [Fog and Flat Clouds only, everything else is off]: ~6.5ms

    Enviro_Nothing.JPG
    Enviro On [All features Off]: ~ 6.5ms

    Enviro_Off.JPG
    Enviro Off [Stopped but not deactivated]: ~4.5ms

    I cannot get my head around the 2ms drop between nr2 and nr3. Visually there is no difference between all features off and Enviro stopped but the performance is quite a bit better.

    Thanks a lot for your help!
    Cheers,
    Simon
     
  41. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi Simon,

    I already know about this issue and also started to work on improving performance when not all effects are in use. In current "old" rendering method it creates and blit through two temporary render textures. This in combination with MSAA will get you to this drop. If you stop enviro it will disable the rendering components so no work on these anymore and you get better performance. However as long as you activate clouds, fog and volume lighting we need those two extra render textures and blits of course.
    But I already added code for a improved rendering logic in EnviroSkyRendering script that should improve performance once you don't use all effects. Please check the EnviroSkyRendering scripot -> OnRenderImage function. There are to region "Old" and "New". Please try to comment the "Old" and uncomment the "New" section and you should see improvements here.

    Best Regards,
    Hendrik
     
    spso likes this.
  42. spso

    spso

    Joined:
    Oct 11, 2017
    Posts:
    17
    Hi Hendrik,

    Perfect! Thanks for your very fast reply. Tried it, love it. Great work!

    Cheers,
    Simon

    P.S:
    On another note, this: https://twitter.com/IRCSS/status/1217142844021932032
    If you have not seen it already.. Looks very nice imho, even with twitters sh**y video compression :) Interesting technique.
     
    Vondox likes this.
  43. Altair44

    Altair44

    Joined:
    Oct 22, 2019
    Posts:
    10
    Does it have a wet system when it rains, compatible with LWRP / URP?
     
  44. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, Enviro does not include a post processing effect or shaders to simulate wetness on your terrain / objects. But it supports synchronizing current wetness with third party shaders like cts or microsplat.
     
  45. menmaninja8

    menmaninja8

    Joined:
    May 4, 2018
    Posts:
    2
    Hello, how i can get event on minute passed? What needs to be edit in scripts?
     
    Last edited: Feb 4, 2020
  46. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    70
    hello,

    what is the best version of unity to use this asset in?
    i was started with this asset in unity 2019.3.0f6 HDRP, but im getting some errors.

    thanks
     
  47. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, you would need to modify multiple scripts. EnviroCore.cs, EnviroSkyMgr.cs and EnviroEvents.cs. You can check with the hour event how to do that. But maybe for minutes it's easier to create your own script that checks enviro time, that also would not break when you update enviro later.

    Please tell me if you need help with that. :)
     
  48. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hello, the asset store version currently does not support HDRP yet. But feel free to join discord and ask me for access to beta group to test Enviro HDRP.

    https://discord.gg/5c6kfW6
     
  49. menmaninja8

    menmaninja8

    Joined:
    May 4, 2018
    Posts:
    2
    Hello, i created a script for check minutes:

    Code (CSharp):
    1. public class EnviroMinutePassedHandler : MonoBehaviour {
    2.  
    3.     private int cashedMinute;
    4.     //Minute Passed event
    5.     private void Start(){
    6.         cashedMinute = EnviroSkyMgr.instance.GetCurrentMinute();
    7.     }
    8.  
    9.     private void Update(){
    10.  
    11.         int currentMinute = EnviroSkyMgr.instance.GetCurrentMinute();
    12.  
    13.         if (currentMinute != cashedMinute) {
    14.             //Minute Passed event
    15.             cashedMinute = currentMinute;
    16.         }
    17.     }
    18. }
    How modify this to interact with minute passed event through other scripts like this:


    Code (CSharp):
    1. minuteHandler.onMinutePassed += () => {
    2.  
    3.             help(.05f);
    4.    
    5.         };
    6.  
    7.         EnviroSkyMgr.instance.OnHourPassed += () => {
    8.        
    9.             Bye ("string parametrs");
    10.    
    11.         };
    12.  
    13.         EnviroSkyMgr.instance.OnDayPassed += () => {
    14.        
    15.             Hello (23);
    16.    
    17.         };
    (For pass any parametrs to any method like in Enviro events system)
     
  50. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi, this should work:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class EnviroMinutePassedHandler : MonoBehaviour
    6. {
    7.     public EnviroEvents.EnviroActionEvent onMinutePassedActions = new EnviroEvents.EnviroActionEvent();
    8.     public delegate void MinutePassed();
    9.     public event MinutePassed OnMinutePassed;
    10.  
    11.     private int cashedMinute;
    12.  
    13.     public virtual void NotifyMinutePassed()
    14.     {
    15.         if (OnMinutePassed != null)
    16.             OnMinutePassed();
    17.     }
    18.  
    19.  
    20.     private void Start()
    21.     {
    22.         OnMinutePassed += () => MinutesPassed();
    23.         cashedMinute = EnviroSkyMgr.instance.GetCurrentMinute();
    24.     }
    25.  
    26.     private void Update()
    27.     {
    28.         int currentMinute = EnviroSkyMgr.instance.GetCurrentMinute();
    29.  
    30.         if (currentMinute != cashedMinute)
    31.         {
    32.             //Minute Passed event
    33.             NotifyMinutePassed();
    34.             cashedMinute = currentMinute;
    35.         }
    36.     }
    37.  
    38.     private void MinutesPassed()
    39.     {
    40.         onMinutePassedActions.Invoke();
    41.     }
    42. }
    This way you can listen to event like this:

    minuteHandler.OnMinutePassed += () => {

    help(.05f);

    };

    Or add actions directly in component inspector.