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. Vondox

    Vondox

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

    yes you could do that! For example: Use the free World Manager API and Enviro WAPI Integration component on your clients. Now you only need to communicate with WAPI which breaks down the weather to three simple floats: Cloud Power, Rain Power and Snow Power. Enviro will choose a matching weather preset on clients based on these three floats send from your server. Same for game time. But you would need to wrote some simple code to have changing weather parameters in your server app of course.

    Hope I could help you!
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, could you please check if the directional light created by enviro has a cookie texture applied? It should be set to none and only apply a render texture on start.
     
  3. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi,
    Is there a way to prevent raindrops showing on screen temporarily when I move into a small building (it looks like it's raining indoors :)). There's a window so it would be great if I could still see the rain through that - but I'd settle for just turning off the raindrops.

    Thanks!
     
  4. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Is there a way to get the current phase of the moon? IE if it's a full moon or not.
     
  5. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I have not heard of the World Manager, looks like it by Adam of Gaia? I will definitely have to take a look at it. It sounds then like it will also work with the MicroSplat integration and all of that once it is released? Thanks for the info!
     
  6. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, already answered here:
    https://forum.unity.com/threads/rel...nd-weather-system.317986/page-29#post-3298465

    You need to setup colliders for your roofes and particle collisions in enviro particle effects.
     
  7. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Sorry, currently not implemented. :/
     
  8. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Yea, it is open source and created by Adam. Here the link to github: https://github.com/adamgoodrich/WorldManager
     
  9. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Microsplat Integration!

    I finished first version of Microsplat Integration for enviro. Please import the package and read the text file for setup instructions. No worries it is easy to use, you just don't want to forget to activate the "Global Driven Property" checkboxes in your Microsplat materials. ;)

    Please send me some feedback for improvements ideas or bugs you may get.
     

    Attached Files:

  10. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Do you have any plans to add this in? Or is there a way I could add it in without a lot of work? There's a feature of my game we're wanting where certain things happen in the world at different phases of the moon.
     
  11. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm first idea that comes into mind would be to calculate the angle between sun and moon to get an idea of what phase we have. Something like this:

    Code (CSharp):
    1.         Vector3 targetDirMoon = EnviroSky.instance.Components.Moon.transform.position - EnviroSky.instance.Player.transform.position;
    2.         Vector3 targetDirSun = EnviroSky.instance.Components.Sun.transform.position - EnviroSky.instance.Player.transform.position;
    3.         angle = Vector3.Angle(targetDirMoon, targetDirSun);
    If the angle is about ~180 degrees it should be full moon for example. ~90 degrees half and so on. Just an idea, not tested and would not be that accurate but maybe you can start from that point. :)
     
  12. SeekingFaith

    SeekingFaith

    Joined:
    Apr 22, 2018
    Posts:
    6
    Yeah, seems to be the issue. If I turn cloud shadow to 0, set the cookie texture to 'none' and save, it remains so. If however I turn cloud shadow up, save and then load back into the scene the cookie cutter has a texture applied again.
    Bug?
     
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Is your directional light part of a prefab? It should set the cookie texture to "none" automaticly when you stop the play mode. However I will have a look into this later.
     
  14. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Great, thank you! I'll give that a shot.
     
  15. SeekingFaith

    SeekingFaith

    Joined:
    Apr 22, 2018
    Posts:
    6
    Directional light is the one that appears when dropping envirosky into the scene, no changes to it. Yeah, there's a texture there. I don't even have to go into play mode. I load back into the scene and a texture has been applied.
     
  16. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi,
    I had an issue previously where the Enviro sky would "smudge" when moving my head in the Oculus Rift (seemed to be multiple light sources - maybe just causing a performance drag). I'm getting it again in a scene with no other lights (except enviro light). It does have a very large terrain. Seems related to the VR pass - please see the video where I turn "Single Pass VR" on/off. In any case there's a strange effect where the mist "pops" on/off at a certain point. I'm also getting weird "horizontal rain" - but I'll save that for later :)



    Thanks for any help!!!

    Unity 2017.3.1f1, GTX 1080.
     
    Last edited: May 1, 2018
  17. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello,

    in the sale there are two interesting assets:

    Vegetation Studio and Map Magic.

    For my next game I want a beautiful procedural randomized (medieval) landscape.

    Can anybody tell me if they are compatible with Enviro?
    Does anybody have experience with one of those?

    Thanks a lot :)

    PS: Question answered by Vondox, thanks a lot :)
     
    Last edited: May 1, 2018
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, do you use the oculus sdk in single-pass mode? Forward or Deferred rendering and what terrain shader do you use? Please also test if you see this issue with the sample scene from enviro. I will do some investigation, but yet never got this issue on my side and I am also using a Oculus Rift for VR tests.
     
  19. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi,
    I have OpenVR set to use "Single Pass" Stereo Rendering Method, Forward shading, TerrainComposer2 and NodePainter.
    I don't get this issue with the demo scene, but I did notice the mist effect "popped" as I moved my view away/back to the sun (as seen in the second half of my video, after I turn off the single-pass checkbox).

    Thanks for taking a look. If you could even suggest what I should look for or avoid (in Profiler, etc.) it would really help!! Thanks!
     
    Last edited: May 1, 2018
  20. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    I think Ive had a similar problem in the past. Check message history or emails. I think then, this had something to do with the camera clear flags
     
    Last edited: May 2, 2018
  21. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I couldn't get it to work unfortunately, but the good news is that Unity put out a Release Candidate for 2018.1 and Enviro works like a dream. Might've just been a beta issue? Not sure. :)
     
    Firlefanz73 and Vondox like this.
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey, guys... anyone know how I can control the falloff of the lightning in Enviro? I've triggered lightning in one of my scenes but the lighting cuts off too abruptly.

    I'd like to ease the flashes a bit.
     
  23. HP

    HP

    Joined:
    Nov 20, 2012
    Posts:
    80
    Yes they are compatible. I use Enviro, Map Magic, Vegetation Studio, CTS and Ultimate Water System.
    Map Magic has a Vegetation Studio Node and a custom Shader Node for Terrain Shaders like CTS, RTP or MegaSplat.
    Map Magic has some issues with terrain borders on multy terrain. But the Dev anounced a feature in Map Magic 2 to reduce the problems of seams on the terrain borders up to completely hide the seams. The Dev sayed the Map Magic 2 update is for free for current customers.

    Vegetation Studio Output Node of Map Magic: https://forum.unity.com/threads/sal...ite-game-map-tool.390920/page-54#post-3416581
    Seam Removal in Map Magic 2: https://forum.unity.com/threads/sal...ite-game-map-tool.390920/page-58#post-3465428
     
  24. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi all, just someone looking into this asset, has anyone got a quick screenshot or demo of views from above the clouds?

    I am wondering whether I could use Enviro if my main focus is to simulate a scene above the cloud (From the video and screenshots I know it handles the ground view pretty well, but annoyingly it's not my game's focus).

    I got "Fog Volume 3" recently because of the same thing, it works, but the lack of usability feature like a simple profile system is killing me (I could go rewrite the main controller but it's a long road ahead given my minimal understanding of it).

    So, I highly appreciate if someone can give me some examples on Enviro, thx in advance :)
     
  25. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm I can have a look into that for next update. I also will add lightning streaks in next update, so a good moment to improve the settings here and give some more options. ;)

    If you want to have a look by yourself: EnviroLightning script handles the flashes.
     
    KRGraphics likes this.
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello, sorry currently not supported out of the box. I need to modify a few things to have good looking clouds from above + fly-through. Only option for that usecase would be using Enviro + Fog Volume 3 right now. There is a component included that can help you get started and can setup a fog volume 3 cloud setup for you in one click. But I don't have a demo or screenshot right now to show you. :(
     
    bitinn likes this.
  27. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    78
    On my phone so haven’t had a chance to run through all the comments properly yet - does enviro support 2018 hdrp?

    Have recently bought it and I’m amazed at the quality of it. Have used sky assets in the past but this is significantly better!
     
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Sorry, hdrp isn't supported at the moment. So for now only the standard rendering is supported in Unity 2018.. Unfortunaly a lot of work is needed to support the new render pipelines, so it will take some time for a stable release.
     
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I already have and it's awesome. I set it up so I can have brighter flashes... a good reference of what I'm doing is using a curve to make the flashes feel less linear.

    And I'm also getting some strange banding in the clouds of my current scene... currently investigating
     
    Vondox likes this.
  30. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Hi, does the asset handles snow over speedtrees and terrain grass? (I'm using the ones that come by deafult in Gaia)
     
  31. T_Strijker

    T_Strijker

    Joined:
    Jun 24, 2013
    Posts:
    18
    Hello Vondox,

    Where using the Enviro tool with great results in our game but we found out that when we put the clouds setting on low in the profile that the clouds settings are still set to normal cloud setting when running the scene. Looking at the code I found that the cloud settings are not set because the lastCloudsQuality variable is set to low when the code starts. This leads the to that the if check code in the update not seeing that the ChangeCloudsQuality method needs to becalled. I have fixed this at the moment by calling the ChangeCloudsQuality code in the start method and passing the CloudQuality from the profile settings.

    This is something worth looking into meaby?
     
  32. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello,
    there is a replacement shader for unity grass included in enviro. But this one is just a simple edit and more of a starting point and it needs some more work to look good. (Shaders -> Grass -> EnviroSnowOnTerrainGrass).

    Snow on speedtree isn't support out of the box. I think I can't ship a modifed speedtree shader with enviro. But you can have a look into some fullscreen snow effects in asset store and use them together with enviro.

    For example "Global Snow" from Kronnect or "Screen Space Snow" from David F. Arppe.
     
    Rodolinc likes this.
  33. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello :)

    Sounds like that you modifed the clouds quality in profile directly and not clicked on "Load From Profile" in EnviroSky inspector. Enviro does not use the profile settings in runtime. You need to use the load and save functionality in EnviroSky inspector. This is also mentioned in basic documentation included in package. ;)
     
  34. Vondox

    Vondox

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

    hm could be related to sky fog. That one is only visible in runtime. But you could change the sky settings (EnviroSky Inspector -> "Edit Profile" -> "Sky Color Power") curve to increase the colors and have a more vibrant sky.
    Oh and when you tweak these in runtime don't forget to click on "Save to profile" and "Load from Profile" when you are back in edit mode. ;)
     
  35. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    How do I get the current amount of rain? I used to be able to get it using EnviroSky.instance.Weather.curWetness, but it currently always returns 0.
     
  36. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Excellent, thanks
     
  37. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Sorry to ask more,

    If I want to change dynamically from say, a "green" sunset to a "white" night would be straghtforward to do?
    (transitioning smoothly from one sky to another)
     
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm, should be working. Maybe check your rainy weather presets "max wetness" setting.
     
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    The sky will be rendered using atmospheric scattering calculations (based on Preetham & Hoffmann model). I also exposed a lot of settings to create non earthlike atmospheres and added curves for saturation, brightness and gradient for custom color tint. So a bit of tweaking needed if you are want to achieve non earthlike results. The transitions will be smooth of course.
     
    Rodolinc likes this.
  40. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    They seem to range from 0.5 up to 1
     
  41. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Hello,

    I recently updated my project to 2018 and also updated Enviro to the march update (I don't know if theres a way in my backup to check what version Enviro was previously), but I am now having difficulty using the ChangeFocus method to swap cameras. Now when I call ChangeFocus to provide it with the same player and the new camera, no clouds render, the skybox is just brown, and no fog is used. Swapping back to the first camera again using ChangeFocus works fine. Either something has been changed to my setup (I have compared my previous settings, prefab, and camera settings and they appear to match with my backup), 2018 broke something, or the update broke/changed how swapping camera works in real time.

    When ChangeFocus is called I know it adds/removes scripts to the camera. Currently the first camera starts with EnviroSkyRendering and two EnviroLightShafts (sun/moon). When camera swap occurs it removes all three scripts and adds ONLY EnviroSkyRendering to the new camera (but clouds do not render).

    I found and fixed the flaw in the source code preventing the EnviroLightShafts being added by adding two if checks inside the loop for function private void RemoveEnviroCameraComponents (Camera cam) in EnviroSky.cs:
    Code (CSharp):
    1.         for (int i = 0; i < ls.Length; i++)
    2.         {
    3.             if (ls[i] == lightShaftsScriptSun)
    4.             {
    5.                 lightShaftsScriptSun = null;
    6.             }
    7.             else if (ls[i] == lightShaftsScriptMoon)
    8.             {
    9.                 lightShaftsScriptMoon = null;
    10.             }
    11.             Destroy(ls[i]);
    12.         }
    This is necessary because ChangeFocus calls InitImageEffects which only adds LightShafts to the new camera if lightShaftsScriptSun/lightShaftsScriptMoon are null; Destroy() does not null out the variable (instantly at least).

    Regardless of the above fix, this only ensures that the lightshaft scripts are added to the second camera. The skybox is still brown and clouds do not render.

    This is how my scripts currently handle the camera swapping:
    • User requests a camera swap
    • A certain amount of time is afforded before commiting the swap (via Coroutine)
    • ChangeFocus called for new camera (via above Coroutine).
    • The next Update() notices the time has elapsed and toggles the cameras.enabled properties (along with adjusting other scripts on the cameras).
    This worked previously but I have also tried toggling the enabled properties right as ChangeFocus is being called. Testing this had no effect on the outcome.

    I still need to investigate if this is isolated to 2018, or if it is just the EnviroSky update.
     

    Attached Files:

    Last edited: May 5, 2018
  42. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Debug inspector comparisons of the two cameras when they are the current active camera:
     

    Attached Files:

  43. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    34
    Hi,

    I have a custom shader I'm using with Enviro, but the fog gets rendered in front of any object with the custom shader. In another post it was mentioned to modify the shader to show fog and volume lighting correctly using the EnviroFogcore.cginc. I tried this and even tried following the Aquas integration in the Scripts folder which shows something similar, but I just get an error when on my shader. Would anyone be able to point me in the right direction making my shader below work with Enviro? Thanks!
    Code (CSharp):
    1.  Shader "Custom/AlphaBlendTransition" {
    2. Properties {
    3.      _Blend ("Blend", Range (0, 1) ) = 0.0
    4.      _BaseTexture ("Base Texture", 2D) = "" {}
    5.      _OverlayTexture ("Texture 2 with alpha", 2D) = "" {}
    6. }
    7. SubShader {
    8.          Pass {
    9.              SetTexture[_BaseTexture]
    10.              SetTexture[_OverlayTexture] {
    11.                  ConstantColor (0,0,0, [_Blend])
    12.                  combine texture Lerp(constant) previous
    13.              }
    14.          }
    15.      }
    16. }
     
  44. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Thanks for your report. I will have a look into that. Do you use 2018.1.0 release or still on beta?
     
  45. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi, please try this if you want a opaque shader:

    Code (CSharp):
    1. Shader "Custom/AlphaBlendTransition" {
    2.     Properties{
    3.         _Blend("Blend", Range(0, 1)) = 0.0
    4.         _BaseTexture("Base Texture", 2D) = "" {}
    5.         _OverlayTexture("Texture 2 with alpha", 2D) = "" {}
    6.     }
    7.         SubShader{
    8.         Tags{ "RenderType" = "Opaque" "Queue" = "Geometry" }
    9.         Pass{
    10.         SetTexture[_BaseTexture]
    11.         SetTexture[_OverlayTexture]{
    12.         ConstantColor(0,0,0,[_Blend])
    13.         combine texture Lerp(constant) previous
    14.     }
    15.     }
    16.     }
    17.     Fallback "Diffuse"
    18. }
    However if you need that shader to be transparent we have to rework the shader to support fog(volume lighting. Tell me if you need transparent version. :)
     
  46. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    34
    It's perfect, thank you!
     
    Vondox likes this.
  47. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Hi there,

    Could anyone who has bought this asset (or the asset developer) give me their view on how well Enviro handles updating the ambient light intensity at runtime?

    I've found with other dynamic light and sky systems that transitions between day and night have heavy performance spikes because they all set RenderSettings.AmbientIntensity and then do a DynamicGI.UpdateEnvironment (); - which is horrifyingly expensive to the point of being unusable.

    Does Enviro do a better job?

    Thanks,
    M
     
  48. Pryzmeister

    Pryzmeister

    Joined:
    Jan 21, 2015
    Posts:
    26
    I cannot get Single Pass VR working with Enviro. I have tried several unity versions and get the same result where everything is very dark. The current version of unity i am trying with is 2018.1.0f2

    I am using the Enviro VR prefab.
    Using CTS on terrain and Speedtrees.

    Comparison images attached. comparison with single pass VR Disabled and then Enabled. I have also removed any post processing effects from my camera to rule that out.

    I have Single pass VR enabled in player settings and that works fine, however if i enable it in Enviro settings, the problem occurs where everything becomes very dark.

    I also notice the follwoing console error only occurs when enabling single pass in enviro

    Setting XR usage of already created render texture is not supported!
    UnityEngine.RenderTexture:set_vrUsage(VRTextureUsage)
    EnviroSkyRendering:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSkyRendering.cs:951)
     

    Attached Files:

    Last edited: May 7, 2018
  49. jobs

    jobs

    Joined:
    Jul 29, 2014
    Posts:
    8
    Thanks for your reply.
    I am sure I dont enable sky fog in my profile. And follow your suggest,I try change the sky color power,but I stail get a different effect between game and scene view. The scene view look better
     
  50. Pryzmeister

    Pryzmeister

    Joined:
    Jan 21, 2015
    Posts:
    26
    UPDATE : SOLVED
    For anyone else having this problem i solved it. I work on 2 machines, a dev machine with monitors then test my build on the machine with the oculus setup. Because when i tested the build on the dev machine and it didnt work, i did not even think to try it on the Oculus machine. So i guess single pass will not work correctly on a standard monitor, but does on the stereo setup.