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. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    I am making a naval game with 1 Unity unit being 1 meter. With EnviroSky Standard, there seems to be a wall of fog at 1000 units. It persists even if I turn off fog within EnviroSky. You can see it in this shot of a ship exactly 1000 units distant. If either ship moves, you see the other slip into a veil of fog.



    I'd like to be able to place ships up to 20,000 or 30,000 units away from the camera and have the weather system only impact visibility according to parameters I establish.

    How can I fix this?

    tone
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm, do you have fog activate in your Unity lighting settings?
     
  3. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    Thanks for the quick response.

    In 2020.1.1's Window/Rendering/Lighting, "Fog" is unchecked on the Environment panel.

    EDIT: Solved. My camera's far clip plane was set to 1000.

    tone
     
    Last edited: Sep 4, 2020
    Vondox likes this.
  4. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    20
    Hi,


    I am using Enviro Sky 2.02 standard version.


    I have set up an interior “zone” with a trigger but when my player (a car) goes into the tunnel (interior zone) nothing happens. This works fin with the weather zone to make it rain, but is not working for the interior. I also noted there are no instructions on interiors in the documentation and I can’t figure out what I am doing wrong...Please can you help? Please note I have dozens of other triggers (including a weather zone) in my scene that all work fine, so I don’t believe it has to do with player setup. I am using Gaia with CTS shaders, but that should have any impact on adjusting the skybox and ambient lighting...


    I have looked on Discord (which I really hate btw) and can’t find a tutorial on how to get it to work easily, I believe I have copied the setup from the demo scene, but nothing happens.


    I have a long tunnel, and I have set a trigger box around the entire tunnel and set the trigger type to “zone”. I have also tried using Entry_exit as well – and nothing seems to work (currently set to trigger layer, but I have also tried it as default and still doesn’t work):
    upload_2020-9-14_21-58-37.png upload_2020-9-14_21-58-37.png
    Any help would be greatly appreciated as I am stuck and have a deadline to deliver this project.
     
  5. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, I already answered your discord question. Please feel free to send me a direct message in discord and we can meet to get this working as fast as possible!
     
  6. zoomj

    zoomj

    Joined:
    Sep 8, 2020
    Posts:
    4
    upload_2020-9-15_22-46-48.png
    These errors occurred when I re-imported the resource pack. I tried to import a brand new project without errors. Why is this, is there any solution?
     
  7. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, please check your Project Settings -> Player -> Other Settings -> Scripting Define Symbols list and remove those defines that indicates to the 3rd party integration you don't have in your project. For example: Global Snow, Megasplat, Pegasus.
     
  8. zoomj

    zoomj

    Joined:
    Sep 8, 2020
    Posts:
    4
    Thank you very much, your solution solved the error of my project, and now it works very well
     
    Vondox likes this.
  9. jimmygladfelter

    jimmygladfelter

    Joined:
    May 3, 2020
    Posts:
    83
    Hello!

    I was just wondering how to configure the min and max wind zone strength.
    Im using speedtrees and with a windzone of 0.25, the trees appear to be thrashing about like they are in a storm.

    I tried these settings, but there doesnt seem to be any effect in the wind zone.
    upload_2020-9-16_21-36-46.png

    I tried changing the strength manually but it seems like the Enviro code is always setting it to 0.25:
    upload_2020-9-16_21-37-48.png

    Any ideas?
     
  10. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, are you sure there isn't some other wind zone in your scene? Otherwise you can set the wind zone strength in each weather preset.
     
  11. jimmygladfelter

    jimmygladfelter

    Joined:
    May 3, 2020
    Posts:
    83
    I do not have any other wind zone. I usually like keeping the wind zone a 0.15. I will look at the weather presets when I get home tonight. Thanks for your help!
     
  12. Juneav

    Juneav

    Joined:
    Feb 18, 2017
    Posts:
    28
    Thanks! It was actually a setting in the camera: In the post-processing component, Directly to Camera Target. Changing this value solved the problem!
     
    camta005 likes this.
  13. Agility3Assets

    Agility3Assets

    Joined:
    May 17, 2013
    Posts:
    4
    Hi, I am using Enviro Standard and I have a World Space Canvas with some TextMeshPro text on it. If crank up the Enviro fog in my weather preset, I can still see the TextMeshPro text, even though it should be obscured by the fog. Does anyone know of a way to get the TextMeshPro text to take account of the Enviro fog??

    ..thanks..
    Andy
     
  14. Agility3Assets

    Agility3Assets

    Joined:
    May 17, 2013
    Posts:
    4
    I should add that my Enviro Fogmode is set to Exponential and the shader I'm using for the TextMeshPro text is TextMeshPro/Distance Field (Surface)
     
  15. alexjet1000

    alexjet1000

    Joined:
    Jul 29, 2020
    Posts:
    21
    Hello,

    I am trying to achieve this visual look for sun and moon
    upload_2020-9-20_13-57-20.png

    but for some reason it only gets that way if i lower the lightning way too much, making everything a bit darker that i would want to.

    If i make it any bright sun becomes brightness and glow.
    Tweaked everything but cant make it happen without loosing intensity.

    Is there a way to keep sun this size when looking at it without making it ultra bright?
    Just to make things clear i want the brightness but not the glow look in the sky.
     
  16. jimmygladfelter

    jimmygladfelter

    Joined:
    May 3, 2020
    Posts:
    83
    I read in recent posts that infinite terrain is possible in Enviro. I'm using map magic for my terrain which can render infinite worlds. Is there any additional setup for this or does it just work out of the box? I guess the default weather zone in the created profile will be omni present anywhere you go? For some reason I thought I saw a defined boundary for this? Something like 50000 x 50000...?
     
  17. eldvbear

    eldvbear

    Joined:
    Jul 21, 2016
    Posts:
    9
    Hello,

    I am having some difficulty with the Satellite feature. I have got it to work once, but when I changed out the prefab for the second moon, it stopped working and will no longer appear in the sky. The Satellite Camera generates inactive, but when enabled still will not display the satellite in the sky. I am a bit perplexed by why it just stopped working. Any insight you can provide would be greatly appreciated. I am using the current version of Enviro Sky and Wealther with Unity LTS 2019.4.10.
     
  18. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Hi,
    Can't remember how to create an enviro zone? I follow the manual but i don't find the object or script to attach??
    Can i make zones with enviro lite mobile instance ?

    EDIT : :oops: oops, my bad, i found out!
     
    Last edited: Sep 24, 2020
    Vondox likes this.
  19. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    Hello,

    My game has its on time control DateTime field which I increment according to gameplay, so on one of my scripts Update() I do:

    EnviroSky.instance.SetTime(myTime)

    My question is, is this good for optimization, or is there a better way?
     
  20. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764

    my opinion worths nothing but do you need it to be updated that much often??
    is it only a date you need? cause you could simply do that with enviro event "on hour passes" or something like that i don't remember well...and only check once a day after midnight then set "mytime" your date....

    Maybe you can simply send from "onhourpassed" a message to your script to get "mytime", it will be less costly..I guess...

    What do you need? Sorry i'm curious :)
     
  21. szaaijerxvrsim

    szaaijerxvrsim

    Joined:
    Mar 9, 2020
    Posts:
    1
    Hello!

    We are currently developing a render pipeline based on URP with Enviro for dynamic weather and time of day. With plenty of options to tweak, Enviro works quite well for us.
    An issue we are currently running into involves ambient diffuse lighting. Because Unity computes an SH basis based on the set Skybox material, we find that only the Skybox is used as the source for ambient diffuse light. With dark clouds, the difference between our reflection probe, which renders clouds overtop, and the Skybox itself, providing the ambient diffuse, is very noticeable. Is there anything we are missing here? Is there a convenient way to have Unity generate the SH basis using Enviro's GlobalReflections probe?
    We have an alternative planned, where we reinterpret the Unity Skybox as a cubemap with Enviro's GlobalReflections probe. We can then exchange the regular skybox rendering with our own pass using Enviro's sky material. Since we are already planning on customizing our render pipeline, changing this should not pose a problem, but it seems like quite a hassle.
    If you have any suggestions, they are very welcome.

    Regards,
    Simon
     
  22. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    My game uses my internal lapsed time variable all the time, to trigger scripted events and many other things related to gameplay. Some monsters spawn at certain day and hour, some quests expire, etc. I can't just let enviro handle that, because sometimes my code also makes the time jump forward (for instance if the player chooses to sleep furing the night or fast-travels). Plus my indoor areas don't have an enviro.

    I could update enviro every X seconds, or every hour like you say, but it's very noticeable, as shadows suddenly jump.
     
  23. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Actually i'm not talking about updating enviro, i don't know if it's possible..I'm thinking of updating your script timeline thanks to enviro. So no problem with shadows and so...Enviro sends the message to your timeline every hour for exemple.
    I did that to have a day night cycle for actions of my NPCs and it works well. But your case is surely different
    let vondox answer better
     
  24. Juneav

    Juneav

    Joined:
    Feb 18, 2017
    Posts:
    28
    Hi!

    Im having an issue with my trees in Enviro 2.3.1, in distance they do not seem to be affected by light or fog, take a look at the screenshots.

    Is there a way to solve this? Thank you very much!
     

    Attached Files:

  25. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    263
    Is height fog verified working in the latest version? I cannot seem to get it to show up, and I've tried all the usual parameters. Changed both params on the main Enviro object as well as the numbers in the weather scriptable object. Cannot seem to get any effect.

    I'm on built in rendering, Unity 2019.4 LTS.
     
  26. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    My game concept would really benefit from a world-wide (our own planet Earth), year-round weather/season/climate system that offers smooth transitions across space and time.

    For instance, I'd like my storms should be defined by a mobile 2D blob of varying shape, size, and saturation so that players distributed across its area see the intensity of the blob over their portion of the map. The EnviroSky emphasis seems to be centered on more static definitions of conditions ("presets", "zones") that might have a subordinate role in my solution, but not really a primary one.

    I feel as though my overall system will rely, to some degree, on "Lerping" between presets to mimick passage of time and motion of the weather systems and players across the map.

    Is there anything in EnviroSky that can provide a Lerp between one preset and another?

    Tony
     
    Last edited: Sep 28, 2020
  27. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    Quick question: EnviroInterior -- how is this used?

    I tried adding it to a GameObject, but I saw no means of defining the boundaries of this zone. I guessed that I was supposed to add a Collider that was isTrigger, but this did not do anything when I walked into it.

    I did see that Enviro knew my camera.

    I was trying to have it reduce the volume of ambient sounds.

    tone
     
  28. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Greetings @Vondox!

    I'm currently experimenting with Enviro Lite Mobile in a Unity 2020.2b URP project.
    Enviro looks fantastic, but isn't fogging my BoatAttack-inspired ocean surface.

    Can you point me in the right direction to modify these transparent shaders?

    upload_2020-9-30_8-46-48.png
     
  29. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello Andy, what shader do you use for your text? We may need to modify that one to support fog.
     
  30. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, do you maybe miss the tonemapping in your scene? Setup some post processing with color grading -> tonemapping module active. That should help with the visuals and is really important. You also can set the sundisk scale in your Enviro Sky Instance -> Edit Profile -> Sky settings.
     
  31. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, there is no boundary for the default weather zone. It will be active as long as you are not in another self created weatehr zone.
     
    jimmygladfelter likes this.
  32. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, hard to tell from here. It's normal that sat cam is inactive. Maybe check the layers?!
     
  33. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, your plan does not sound that bad. Currently no other solution in mind, but I haven't really digged into it yet in URP.
     
  34. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, already send you a replacement shader in discord today. Also will upload it her for others. (Unity 2019.4)
     

    Attached Files:

    Juneav likes this.
  35. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm strange. Should work correctly but only visible in game view. Maybe send me your profile and preset and I can have a look.
     
  36. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello Tony, Enviro only can have one weather active (visible) at a time for your scene. You can have multiple biomes with different weather active but won't see that from distance.
     
  37. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    You need to set the "Zone Trigger Type" to " Zone" and then click on "Create new Trigger". Then scale that created trigger. Also make sure that your layer of the interior zone can interact with the Enviro Sky Instance layer (Ignore Raycast by default) in your Unity project settings > physics > layer collision matrix.
     
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, is that ocean a shadergraph shader? If yes you can try this guide to get fog on your transparent shadergraph shaders.
     

    Attached Files:

  39. Juneav

    Juneav

    Joined:
    Feb 18, 2017
    Posts:
    28
    Thank you very much! I'll test it asap!
     
    Vondox likes this.
  40. Juneav

    Juneav

    Joined:
    Feb 18, 2017
    Posts:
    28
    Tested and verified it works fine now! Thank you very much! I added some screenshots on Discord of how it looks now!
     
    Vondox likes this.
  41. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Thanks Vondox! The BoatAttack ocean isn't a shadergraph shader, but it does use the URP /ShaderLibrary/Core.hlsl for fog calcs and a few modifications to your provided example got the job done nicely
     
    Vondox likes this.
  42. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    I assumed this, but I'd like to have the (headless) server able to tell clients, distributed over a planet-wide area, what their local weather is, and have the differences in weather vary smoothly in space and time. By this, I mean that if you stay in one place, weather might change smoothly over time, and that others players near you (say 10 miles) see weather similar to yours that becomes more so as they approaches further.

    I may look into your classes for cloud config and similar. Your methods like UpdateClouds() clearly show the pattern of Lerping from one condition to another.

    tone
     
  43. diggerjohn

    diggerjohn

    Joined:
    Apr 28, 2009
    Posts:
    60
    Assets\Enviro - Sky and Weather\Core\URP Support\Scripts\EnviroBlitPass.cs(29,9): error CS0246: The type or namespace name 'RenderTargetHandle' could not be found (are you missing a using directive or an assembly reference?)

    I am just starting with Enviro.
    Following your documentation for set up.
    When I get to step that tells me to Import the LWRP/URP support files .... I pick Import LWRP?URP Support for Enviro Standard ....
    Then I get the above warning .... What is the problem????
     
  44. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, is your project using LWRP/URP? Otherwise if you choose the built-in pipeline you want to delete the whole enviro fodler and import again. Those steps are only needed when using LWRP/URP.
     
  45. diggerjohn

    diggerjohn

    Joined:
    Apr 28, 2009
    Posts:
    60
    Ok, I'm a total newb with this.
    I guess the answer is likely no.
    I will start over and bypass this.
    Thanks.
     
  46. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    No problem. :)
     
  47. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Right at like 5:45 AM the ground lighting seems to take a sharp turn from the night ambient blue that dark but still visible enough to navigate, to all the sudden pitch black for a while. Which settings can I tweak to resolve this?
     
  48. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, you can set the ambient colors in yoour Enviro Sky Instance -> Edit Profile -> Lighting category. Do you also checked if it isn't related to the moon maybe?
     
  49. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    Vondox ... I found it helpful to add a little code to EnviroZone which makes it much easier to use your code on a server whose clients may be in different zones. Essentially, I added a list of IEnviroWeatherWatchers to each Zone. Colliders entering and exiting the zone that are IEnviroWeatherWatchers are added or removed from this list, and they are apprised of changes to the weather.

    This gives me a very easy place to insert code to send network messages to each player to tell him about his local conditions. The downside: if a provision like this is never added to your code, my code becomes a little more fragile in the face of EnviroSky changes.

    Code (CSharp):
    1. // I added this in EnviroZone
    2. public interface IEnviroWeatherWatcher
    3. {
    4.     void onEnterWeatherZone(EnviroZone p);
    5.     void onExitWeatherZone(EnviroZone p, EnviroWeatherPreset defaultPreset);
    6.     void onNewWeather(EnviroZone p, EnviroWeatherPreset w);
    7. }
    8.  
    9. // new data member for EnviroZone
    10. List<IEnviroWeatherWatcher> watchers = new List<IEnviroWeatherWatcher>(); // TONE added this
    11.  
    12. / ... and in WeatherUpdate()
    13.  
    14.     void WeatherUpdate ()
    15.     {
    16.         nextUpdate = EnviroSkyMgr.instance.GetCurrentTimeInHours() + WeatherUpdateIntervall;
    17.         nextUpdateRealtime = Time.time + (WeatherUpdateIntervall * 60f);
    18.  
    19.         BuildNewWeatherList ();
    20.  
    21.         lastActiveZoneWeatherPrefab = currentActiveZoneWeatherPrefab;
    22.         lastActiveZoneWeatherPreset = currentActiveZoneWeatherPreset;
    23.         currentActiveZoneWeatherPrefab = PossibiltyCheck ();
    24.         currentActiveZoneWeatherPreset = currentActiveZoneWeatherPrefab.weatherPreset;
    25.         EnviroSkyMgr.instance.NotifyZoneWeatherChanged (currentActiveZoneWeatherPreset, this);
    26.  
    27.         // TONE added this bit
    28.         if (lastActiveZoneWeatherPreset != currentActiveZoneWeatherPreset) {
    29.             foreach (IEnviroWeatherWatcher w in watchers) {
    30.                 w.onNewWeather(this, currentActiveZoneWeatherPreset);
    31.             }
    32.         }
    33.     }
    34.  
    35. // and in OnTriggerEnter...
    36.  
    37.     /// Triggers
    38.     void OnTriggerEnter (Collider col)
    39.     {
    40.  
    41.         if (EnviroSkyMgr.instance == null)
    42.             return;
    43.  
    44.         // TONE added this bit
    45.         IEnviroWeatherWatcher watcher = col.gameObject.GetComponent<IEnviroWeatherWatcher>();
    46.         if (watcher != null) {
    47.             watcher.onEnterWeatherZone(this);
    48.             watchers.Add(watcher);
    49.         }
    50. ...
    51.  
    52. // and in OnTriggerExit
    53.  
    54.     void OnTriggerExit (Collider col)
    55.     {
    56.         if (ExitToDefault == false || EnviroSkyMgr.instance == null)
    57.             return;
    58.  
    59.         // TONE added this bit
    60.         IEnviroWeatherWatcher watcher = col.gameObject.GetComponent<IEnviroWeatherWatcher>();
    61.         if (watcher != null) {
    62.             EnviroZone defaultZone = EnviroSky.instance.GetComponent<EnviroZone>();
    63.             watcher.onExitWeatherZone(this, defaultZone.currentActiveZoneWeatherPreset);
    64.             watchers.Remove(watcher);
    65.         }
    66.  
    67.  
     
    Vondox likes this.
  50. diggerjohn

    diggerjohn

    Joined:
    Apr 28, 2009
    Posts:
    60
    VRTK ....
    I saw a discussion back in 2017 about Enviro and VRTK but not very enlightening to me now.
    Is there a tutorial out there that will help me use Enviro with VRTK?
    I have your current documentation and there is no mention in it of VRTK or Steam.
    I am using SteamVR for the headset rendering.
    Thank you.