Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    157
    hello
    2.1.2
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, thanks for your report! I have fixed the issue now and also send you an hotfix in private message. The fix will be included in next update aswell.
     
  3. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, you would need to remove that feature in code. Please take a look into EnviroCore.cs script and search for "CalculateStarsPosition" function. Just don't call it or don't send the "_StarsMatrix" to shader should stop the rotation of those textures.
     
  4. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    You can use those lines to set your day/night length in your script:

    EnviroSkyMgr.instance.Time.DayLengthInMinutes = 1f;
    EnviroSkyMgr.instance.Time.NightLengthInMinutes = 1f;
     
  5. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    157
    thanks

    if i update to the latest version is the same code?
     
  6. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    111
    Looks like assigning a value to EnviroSky.instance.Audio.ambientSFXVolume while timeScale=0 (paused game) doesn't take effect until game resumes again. Is there a way to force the volume change?

    I want the user to adjust the volume in a settings window while the game is paused. The ambience is still playing so I'd like the changes to happen while timeScale=0.
     
    Last edited: Mar 30, 2020
  7. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Yeah, that changed in last update. You know have three settings here. One to set the cycle(24h) length in minutes and two modifier sliders to tweak progress speed for day/night.

    EnviroSkyMgr.instance.Time.cycleLengthInMinutes = 10f;
    EnviroSkyMgr.instance.Time.dayLengthModifier = 1f;
    EnviroSkyMgr.instance.Time.nightLengthModifier = 1f;
     
  8. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, yeah I see. Please take a look into the Update function of EnviroAudioSource script. Here we are lerping the current volume with Time.deltaTime. I think you may need to change that when you are paused your game to set volume directly.
     
  9. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    135
    Both terrains made purely in World Creator PRO Standalone. Unity HDRP, Terrain shader - Microsplat, Light and atmosphere - Enviro HDRP beta. Textures from Gametextures.

    Screenshot Companion to make screenshots :)
     

    Attached Files:

    blacksun666 and Vondox like this.
  10. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hi, I'm just wondering how to setup the season base temperature curves
    Not sure how the values represent the temperatures

    Cheers Jim

    upload_2020-3-31_13-32-1.png
     
  11. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    135
  12. sekever-n00b

    sekever-n00b

    Joined:
    Nov 4, 2017
    Posts:
    66
    ...ill figure it out somehow, im to full of ides.
    Im on Unity 2019.3.3f1 fresh new project new scene rebuild, runs ok but in console i get 999+ messages repeating

    NullReferenceException: Object reference not set to an instance of an object
    EnviroSkyMgr.GetCurrentTimeInHours () (at Assets/Enviro - Sky and Weather/Core/Scripts/EnviroSkyMgr.cs:1620)
    EnviroZone.Start () (at Assets/Enviro - Sky a

    NullReferenceException: Object reference not set to an instance of an object
    EnviroSkyMgr.get_ambientAudioVolume () (at Assets/Enviro - Sky and Weather/Core/Scripts/EnviroSkyMgr.cs:2290)
    EnviroAudioSource.Start () (at Assets/Enviro - Sky and Weather/Core/Scripts/Utility/EnviroAudioSource.cs:45)

    NullReferenceException: Object reference not set to an instance of an object
    EnviroSkyMgr.IsStarted () (at Assets/Enviro - Sky and Weather/Core/Scripts/EnviroSkyMgr.cs:1172)
    EnviroZone.LateUpdate () (at Assets/Enviro - Sky and Weather/Core/Scripts/EnviroZone.cs:295)

    and stuff like that, should i be concerned ?
     
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello Jim, please take a look into the default internal profile (Enviro - Sky and Weather -> Core -> Profile -> Internal) Those curves are evaluated based on 24h hour cycle. So middle of curve is 12:00 pm.
     
    llJIMBOBll likes this.
  14. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hi, that does not look good. :D Can you try to resetup enviro in your scene? So delete everything related to enviro in your scene and setup fresh like described in documentation.
    If you already done that we may have to take a more detailed look why it giving you such errors. Please send me a private message then.
     
  15. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    14
    I am sorry but I can't find simple to follow tutorials on how to work this system - can you link some? And with over 100 pages of forum posts it is a bit hard to find a clear answer. In a nuttshell:

    I want to change weather based on a trigger?

    In essence I want it to become overcast, then lead to rain when the player enters an area, and then clear up as they leave. I have seen the documentation about weather zones, but I am not sure how to implement this. Can you please provide some clear steps/tutorial (or direct me to one)? I have searched the forum but it is a nightmare to wade through.

    The document says to just add an empty object and apply “weather Zone”...yet under components -> Enviro that does not exist...in version 2.3

    Please will you provide clear and easy to understand details on what the different components do and some tutorials? For example there is an “Enviro Trigger” but no documentation (that I can find).

    thanks in advance (I have sent an email too)

    cheers
     
  16. Vondox

    Vondox

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

    thanks for your feedback! I will add some more information how to use some of the utility components in documentation later. I actually know that not all those components are currently included there. Regards the Weather Zones I think you just missed the option here maybe? It's clearly there for me:

    upload_2020-4-2_14-38-19.png

    However in your case you may better would create your own custom script to change the weather exactly the way you want it. I created a script for you that should pretty much do what you need here. I also added some comments for you to understand what each line will do here.

    Here are the steps to setup your trigger (this is basic Unity stuff here and you can find plenty of tutorials on internet):

    1. Create a new 3D Cube object in your scene. (Right-Click in your Scene Hierarchy -> 3D Object -> Cube)
    2. Select the cube and move and scale it to your area you want to have your trigger event.
    3. Deactivate the "Mesh Renderer" component here and acticate "Is Trigger" in the collider component.
    4. Add the script that I attached here. Know you only need to assign the weather presets that you want to get activated when you enter/exit the trigger. (Please note that those need to be included in "Weather Preset" list at the Enviro Zone component that is added to your Enviro Sky Instance (Enviro Sky Standard for example).

    Your created object should look like this:
    upload_2020-4-2_14-59-24.png

    When you now enter the trigger zone the weather should change to the enter one and when you exit it will change to exit one.

    I hope that helped! :)
     

    Attached Files:

  17. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    14
    clear sky.JPG absolute legend - I will give it a go right now, thanks for the help.

    And yes, I was looking at "add component" button on an object and not in the drop down menu under Component menu

    However, now it seems that no matter what I set the "Start Weather Preset" to the sky is clear blue as you can see from my screen shot below. The sky is clear blue, but the start weather preset is Cloudy 4. When I chge the weather at run time with the drop down menu, nothing happens in-game. I suspect therefore there is a rendering issue as no clouds are visible at all.

    also when I enter the trigger the weather changes a bit, but then reverts after only a few seconds even though I am still inside the trigger volume...

    I'm struggling to get my head around all the settings and what they do. I have read the 24 page documentation, but it is sparse on details, do you have tutorials anywhere (video preferably with audio) that can help me just understand what it all does?

    So I reinstalled the whole thing, and tried to import the URP as per the instructions and ended up with 50 errors: URP errors.jpg clear sky.JPG
     
    Last edited: Apr 4, 2020
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    What Unity version / LWRP version are you using?
     
  19. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    14
    Unity 2019.3.6f1 - no idea about LWRP, when I started the project I'm pretty sure I just selected "3D"
     
  20. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Yeah, then importing the LWRP/URP support was not the right choice. :D

    Please delete the Enviro - Sky and Weather folder and reimport. This time do not activate and import URP support and clouds should show up.
     
  21. mbhagat

    mbhagat

    Joined:
    Dec 15, 2013
    Posts:
    27
    My game envrionments are prefab based.
    Level(environments) are loaded run time but scene remains same.
    Environemnt can be jungle , ary base , street or beach.
    How this system can help here ?
     
  22. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    14
    so I deleted the folder, and reinstalled it. I left it on all the default settings and pressed play. The time and lighting changed, but there are no visible clouds at all. I tried changing "current weather" while the game is playing and still no clouds

    I also changed the starting weather from clear to clouds 4 and no clouds visible

    I am also using Gaia and CTS
     
    Last edited: Apr 4, 2020
  23. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    691
    Hi, Anyone know why the skybox doesnt display in edit mode. But then works in play mode?

    using Enviro Beta version with latest HDRP and Unity Realease.
    sky.jpg
     
  24. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, you can setup enviro in your scene and then load your environments in runtime and have them dynamic sky and lighting for your environments.
     
  25. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Please check your main camera. Make sure that "EnviroSkyRendering" component is enabled. Maybe also take a look into the sample scene and check if it is working correctly here.
     
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, you most likely only need to activate the skybox in your scene view:

    upload_2020-4-4_15-30-34.png
     
    Hawk0077 likes this.
  27. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    691
    Thanks Vondex, much appreciated. I am backing up at present but will inform you of the result soon. Thanks again for your patience, and development efforts etc. Much appreciated.
     
    Vondox likes this.
  28. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    691
    That was it, thanks. Doah!
     
  29. anseyder

    anseyder

    Joined:
    Feb 5, 2018
    Posts:
    14
    it doesn't seem to work in the example scene either also, I cant find the "EnviroSkyRendering" on my camera, so I clicked Add component and added it through that and I also tried just adding the script, but in both cases it wouldn't let me activate it on the object using the tickbox. How and where is the best way to find and activate this component? you can see the box has a blue outline, that is because I clicked on it but the tick to activate will not appear.
    Was this supposed to be automatically added somehow?

    wont activate.JPG
     
  30. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Hello,

    is it possible to make the weather update to any preset thats not the current, I have the WeatherUpdateMode set to real time minutes and the value is 1 but sometimes Im waiting 5 mins to switch it so I think its picking the same preset Im currently using? Also the shift in weather happens very quickly for like 1 second, is it possible to the transition smoother? I plan to increase the weather update interval to something like 15, maybe this will affect it? I can't run proper tests now because if it keeps picking the same preset I may have to spend an hour waiting to see the transition.
     
  31. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,394
    I just love when assets work well together :) Just tried the latest update to Asset Maiden's Western Town. Scenery looked most awesome, but the sky was too blank for my personal taste and it lacked weather dynamics, so 1 minute later Enviro got added:

    e3.jpg
    e2.jpg
    e5.jpg
    e4.jpg
     
    ftejada, Vondox and Bartolomeus755 like this.
  32. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    135
    Vondox likes this.
  33. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, yes I can add an option here to make sure that the same weather preset won't be picked twice. About transitions you would need to check the transition speed settings in your Enviro Sky Instance -> Edit Profile -> Weather category.

    Edit: Send you a package with that option. That also will be added to next update.
     
    Last edited: Apr 8, 2020
    skinwalker likes this.
  34. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,394
    Enviro clouds are the best on the store imo :)

    rider 3.jpg
    rider 2.jpg
    rider 18.jpg
    rider 1.jpg
    rider 11.jpg
     
    Bartolomeus755, mmaclaurin and Vondox like this.
  35. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    37
    Once I enabled black ground mode, I couldn't disable it anymore (this is on latest URP). Oh, and it makes it infinitely 'bright' so the bloom postprocess effect turns the whole screen white if you look at it, even though the ground is black.
     
  36. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    37
    In the end I could only fix it by reverting the whole folder with git.
     
  37. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    37
    Here's another problem I could use help with. I'm using latest URP and latest Unity, and I created and applied the Enviro renderer. When I turn on Distance blur and tweak the settings, it doesn't do anything except to brighten or darken the background - there's no blur at all. I'd appreciate any help.
     
  38. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    691
    Not sure about now but a month or so ago there was a problem with blur. Motion blur in particular, which could have spilled over into the blur too? JUst an idea of something I heard. Not sure.
     
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Thanks for your report! I will have a look into that and include a fix for distance blur in URP in next update.
     
  40. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hola Vondox- thiese instructions no longer work with Crest.
    1. There is now a conflict between ComputeFogFactor in your enviro includes and other things included. I was able to work around this by renaming your ComputeFogFactor (and all uses of it in Enviro)
    2. input.worldspacepos.xyz no longer exists in the Crest context. There is a input.positionWS_fogFactor.xyz which seems to work but in maximum fog positions the ocean is really bright, so might be overdoing the fog on ocean.
     
  41. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, what render pipeline version of crest?
     
  42. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hello, I am using URP. My hacks do seem to work pretty well:
     

    Attached Files:

  43. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Yeah, the URP version is a little bit different here and I also created a guide for that version.
     

    Attached Files:

    mmaclaurin and treshold like this.
  44. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Thank you! But I think this still leaves one issue that may be new:
    1. There is now a conflict between ComputeFogFactor in your enviro includes and other things included. I was able to work around this by renaming your ComputeFogFactor (and all uses of it in Enviro)

    I haven't retested but pretty sure my early test still will have the same challenge.
     
  45. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Do not use the .cginc include here use the .hlsl one like it is written in guide. The function is already renamed here so you don't need to mess with the other enviro shaders. :)
     
    mmaclaurin likes this.
  46. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    609
    HI @Vondox !!!
    Enviro supports HDRP? If so, does Enviro need to use a camera (other than the MainCamera) for its operation?
    The loss of performance that HDRP has per camera is terrible

    Cheers
     
  47. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    Hello, yeah HDRP support for Enviro is in open beta test on our discord channel. https://discord.gg/5c6kfW6

    And no Enviro does not use additional cameras as long as you don't want to use the optional "additional satellites" feature.
     
  48. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    609
    Thanks for the quick reply @Vondox. What option is this "additional satellites" ?? sorry but i don't understand what you mean.

    For example one of the things that interests me the most (for HDRP) is the northern lights, clouds ...
    Do these features work in HDRP?
    On the other hand, before buying I would like to know one last thing ...
    If there is something I don't want to use from Enviro (for example volumetric light, fog or clouds), can I "disable" those features to use my own?

    regards
     
  49. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,132
    That feature is used to render some other objects in space. For example a planet in background or something like that. Here we use an extra camera to render to a rendertexture that will be sampled in skybox.

    You still will have the moon and sun when you don't use that feature.
     
  50. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    609
    @Vondox You did not respond to this ;) ... greetings
     
unityunity