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
    Okay I have quickly updated the WebGl demo to latest version. Please note enviro requires WebGL 2.0! Have Fun. :)

    Get me to the WebGL Demo!
     
    hengeworks likes this.
  2. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Prior to importing Enviro, a transparent shader I'm using for an overlay animation was working just fine.

    After adding Enviro to the scene, the 100% transparent areas of the shader are now a bit opaque -- look at the clear square region around the character below to see what I mean.

    Is this a known phenomenon?

    A few notes:
    • I've seen some notes about transparency handling with fog, but fog is turned off in this scene.
    • As shown in the code below, I'm targeting Unity shader model 3.0, but reverting to the default shading model vua '#pragma surface surf Standard alpha' gives the same results.



    My shader for the square area above is here:

    //-----------------------------------------------------------------------------
    // Custom Nudge Card shader
    //-----------------------------------------------------------------------------

    Shader "Custom/NewSurfaceShader" {
    Properties
    {
    _Color("Color", Color) = (1,1,1,1)
    _MainTex("Albedo (RGB)", 2D) = "white" {}
    //_MainTex("Color (RGB) Alpha (A)", 2D) = "white" {}
    _Glossiness("Smoothness", Range(0,1)) = 0.5
    _Metallic("Metallic", Range(0,1)) = 0.0
    _Blend("Blend", Range(0,1)) = 0.0
    }
    SubShader
    {
    Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" }
    LOD 200

    CGPROGRAM
    // Physically based Standard lighting model, and enable shadows on all light types

    #pragma surface surf Standard alpha:fade
    //#pragma surface surf Standard alpha
    //#pragma surface surf Lambert alpha

    // Use shader model 3.0 target, to get nicer looking lighting
    #pragma target 3.0

    sampler2D _MainTex;
    struct Input {
    float2 uv_MainTex;
    };

    half _Glossiness;
    half _Metallic;
    fixed4 _Color;
    float _Blend;

    void surf(Input IN, inout SurfaceOutputStandard o) {
    // Albedo comes from a texture tinted by color
    fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
    o.Albedo = c.rgb;
    // Metallic and smoothness come from slider variables
    o.Metallic = _Metallic;
    o.Smoothness = _Glossiness;
    o.Alpha = (0.5F - c.b) - (1 - _Blend);
    }
    ENDCG
    }
    FallBack "Diffuse"
    }
     
    P_Jong likes this.
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    upload_2017-11-26_1-31-50.png

    This is the probably the SCARIEST sky I've ever done.
     
  4. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm hard to tell, please try to deactivate the EnviroSkyRendering component on your camera to test if it is related to enviro image effect.
     
  5. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Looks great!
     
  6. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hi Vondox,

    when I run in Debug mode I get an error with exception here:

    _preLightPass.Clear();
    _afterLightPass.Clear();

    These are both null. I used the Enviro prefab, turned off the General reflection and changed the daytime length and the ambient light values and turned hdr off, nothing more.

    I am using Gamma and hdr off.

    Any idea? Thanks!
     
  7. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Whenever I make a build, the directional volume light is missing. I´m using gamma space, HDR on.
    Any suspission ?
     
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So with the ease of creating skies, how does enviro handle Global Illumination? I often ask this because I sometimes use Enlighten for lighting my static geometry and the lighting looks extremely detailed. And most people try to avoid using it. And I assume the reflection probes for enviro are runtime probes, because I already have reflection probes in my scenes but the one enviro has overrides everything.

    Also will future versions have options for lightning flashes in clouds? I like I can use my particle prefabs for weather effects :).
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Enabled Linear Rendering
     
  10. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! Grabbed this asset right away ! I use ufps too.. wich have 2 cameras.. how to do this?
     
  11. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    What's the best way to destroy Enviro when changing scenes?
    Every method I try results in multiple errors as various scripts with Update() use EnviroSky.instance.xxxx without checking if Enviro.instance exists.
     
  12. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Please add the Enviro/VolumeLight shader in "Always Included Shaders" list in unity project settings -> graphics.
     
    Marcos-Elias and Firlefanz73 like this.
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    The included Reflection Probe is atttached to EnviroSKy object. The intensity, update interval and scale will be controlled in "Lighting" category in "Edit Profile" section.

    There is also a component EnviroReflections you can add to your own reflection probes. That one will call updates based on time of day. Just make sure that you set your reflection probes to Realtime -> Via Scripting.

    You should be able to bake precomputed gi with enlighten the normal way.

    Yea I will add lightning flashes to clouds in 2.1. :)
     
  14. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    First create a new layer and name it "moon". Assign that layer in "Rendering Setup" -> "Moon Layer" in EnviroSky inspector.

    Now you only need to assign your WorldCamera as you Player Camera and your UFPS root as Player in "Player & Camera Setup" in EnviroSky inspector.
     
    mattis89 likes this.
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Perfect... I already have my probes set to realtime. I went to bake my GI and lost the lighting... I will keep playing with it and see what happens.
     
  16. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    I already fixed a lot of older components with a check in 2.0.1. To remove the scripts on your camera you can call EnviroSky.instance.RemoveEnviroCameraComponents (Camera cam);

    I will havea look now and create an easy function to remove enviro from your scene in 2.0.1. I already added an option to use "Don't Destroy On Load" for enviro objects or not in 2.0.1.
     
    LukeDawn likes this.
  17. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    This seems to solve the Problem with the strange Colors when global reflections are on, too.
    I will look and test more. Looks very good no and I have currently no more Problems, thanks :)
     
    Vondox likes this.
  18. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Hey, I hear that Enviro will support MicroSplat Snow module soon. That's excellent news! I was playing around with the snow module and found that, to create a realistic effect of increasing snow on the ground (during a snowstorm), I needed to adjust both Amount and Angle Range simultaneously. Will the Enviro interface allow me to configure that?
     
    LukeDawn likes this.
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So in my testing, I still can't get my own reflection probes to reflect the environment in my game which is quite bothersome... I am not using time of day and it is kind of odd that I can't get my scene to properly reflect... could I disable Global Reflections and use my own probes?
     
  20. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Sure, take a look in "Lighting" category in "Edit Profile" section.
     
  21. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hehe, yeah I just talked with Jason and will start working on that integration after I finshed the new documentation.

    Thanks for mentioning, I will have look into that!
     
    LukeDawn likes this.
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'll look at that. I'm having so much fun. I even made my own depiction of Hell... with a red sky, similar to Mars. Also, I end up setting my reflection probes to realtime>Every Frame>All Faces At Once. (It's my first time using it. Otherwise I would use SSR)
     
  23. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    58
    Thanks for the quick support Vondox! With your help I got the shadows back in Enviro 2.0.
    Also I'm making use of the WorldManager and Enviro integration. I've got an opening
    timeline sequence in my Oculus Rift VR game where the player triggers playing a timeline sequence.
    The Enviro WAPI Integration script works perfectly and I'm able to control many features
    from the Unity timeline now with the World Manager API by Adam Goodrich. Here is a sneak peak at the opening
    scene to my VR experience/game. In this timeline sequence I only shift time back from 9 am to 4 am.

     
    hengeworks and Vondox like this.
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I currently don't expose angle range as a potential global variable, but it would be very easy to do so. While I was at it, I also exposed stuff in the streams module (global wetness, streams max, rain drop intensity, puddle amounts) and the new wind particulate module (wind direction, wind strength, and snow strength). Anyway, let me know what people want to control on a global scale and I can add options for it.
     
    eaque, LukeDawn, gecko and 2 others like this.
  25. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Not sure if this is an Enviro question or a "I don't know what I'm doing with my camera" question but... I have a 2 camera FPS player setup and I'm using a terrain on a "Default" layer with some basic trees on that layer. Pretty simple. My Issue is the clouds. They are clipping through the trees (see attached pic). Any ideas?
     

    Attached Files:

  26. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    Hello. Is there a way to use my own 4K static skybox instead of the built in clouds? I would like to swap out static skyboxes for different scenes, and just use the enviro effects (but not the built in enviro clouds)
     
    KRGraphics likes this.
  27. runningbird

    runningbird

    Joined:
    Sep 3, 2009
    Posts:
    382
    Playing around and wow that's all I have to say :)

    upload_2017-11-27_12-16-51.png
    upload_2017-11-27_12-17-7.png
     
    P_Jong, Vondox and KRGraphics like this.
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Looks like that you using the builtin unity tree rendering. That one have issues with depth buffer and won't work correctly. If you want to use unity treecreator trees you should switch to a third party vegetation rendering asset. A cheap one would be AltTrees. But there are multiple systems out in Asset Store and also the upcoming feature-packed Vegetation Studio.

    You also could switch to SpeedTree that one would work out of the box.
     
  29. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Yes, that is possible. You can assign our own skybox material in sky section of your profile.

    upload_2017-11-27_19-39-19.png
     
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    In the sky menu, you can use a custom cubemap or shader
     
    Vondox likes this.
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I have full HDR skyboxes and they work, very well with enviro... even FP16. I definitely need to figure out ways to use Baked GI (Not using Time of Day) or crank up the sky ambience... I'll do a simple test. Actually, is it possible to add HDR power to this? And also, I'm trying to seek a way to use a baked reflection probes with this. For some reason, parts of my scene doesn't light correctly.

    As far as lightning in the clouds, Red Dead Redemption is great as an example. And I hope we can have a way to play random sound, like several thunder clips
     
    Last edited: Nov 27, 2017
  32. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Lightning and thunder will be fixed in 2.0.1. I don't see a problem with using baked GI if you set "time progress mode" to "None". You also can choose to use skybox ambient mode in Enviro inspector and control the ambient intensity in unity lighting tab.
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'll have to try this. And hope I can match the HDR static cubemap closely
     
  34. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    SpeedTree - a million times better. Should've known. I was using a tree that came with the asset I picked up.

    Thanks.
     
    Vondox likes this.
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    upload_2017-11-27_23-17-31.png

    Getting closer to the look I am going for... trying to match the lighting from the old static HDR skybox from this level... a good workflow for this is change something in the sky during play and hit Apply All Settings to see the change... trilight seems to work best for this set up.


    EDIT: And for some reason, I can't change the Ambient Intensity of the skybox...
     
    Last edited: Nov 28, 2017
    P_Jong likes this.
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    upload_2017-11-27_23-46-19.png

    So here is the original static skybox... and I am trying to closely match it...
     
    LukeDawn likes this.
  37. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I just bought this for a project where I need to fly above the volumetric cloud layer.
    I've been testing on a VIVE. However, it's not possible to move the camera above the base of the volumentric cloud layer as it disappears, and a jagged black band shows. Try it with the demo scene, set the y position of the camera to 5000 or so.

    Is it possible to do this?
    Seems like a serious limitation. I've been doing it with Time Of Day + Fog Volume 3 and was assuming it would be possible to do it with this. Would you have a workaround?

    ty.
     
  38. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    Awesome work there. What character system is that, I don't recognize it?
     
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi,
    I send you a mail. Currently flythrough are not supported, but planned to be added in a later update.

    For now you could stick with Fog Volume and use the enviro integration.
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    These are my own characters. On the static skybox, the sun has a very high intensity (it's 65,000 for RGB) and I'm trying to match it, but the sky becomes nuclear. Also I want to set the skybox color below the horizon to pure black.
     
    Last edited: Nov 28, 2017
    LukeDawn likes this.
  41. amigueloferreiracvedia

    amigueloferreiracvedia

    Joined:
    Oct 3, 2017
    Posts:
    3
    Hi!

    I´m trying out Enviro 2.0 but I am having some troubles getting it to work properly with the OpenGLCore API.

    I created a new project, imported Enviro 2.0, opened the sample scene and hit play. This is what I see in play mode

    Unity_2017-11-28_18-16-18.png

    But if I build the scene I end up with this

    NVIDIA Share_2017-11-28_18-16-53.png

    This problem only happens on OpenGL: if I change the API to Directx, it works correctly. I am using Unity 2017.2. Do you have any idea of how to fix this?
     
  42. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Will be fixed in 2.0.1 that already is in review and should be online soon.

    Edit: Just got notification 2.0.1 is live. Please update and test again!
     
    P_Jong likes this.
  43. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    I will have a look and add an option for ground color in skybox for next update.
     
    KRGraphics likes this.
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Sweet. And is the skybox ambience locked? I was trying to set the sun to something really intense, but it blows up the sky.

    What I could do is bake a clear skybox, and make sure it's full HDR. And add enviro on top of it like clouds and move the sun to match the sun in the HDR skybox. I usually make skies I'm Vue so this new workflow should help, minus waiting 42 hrs for a HDR skybox to render... the closest I've gotten to matching my hdr is setting ambient mode to trilight

    I also noticed cloud layers are not in 2.0...
     
  45. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hi I have R.A.M river auto material, and there is the same problem as with aquas shader no fog on it. Could you please preapre instruction for this shader becasue this one from aquas doesnt work for that, I mean there are no lines in R.A.M as yudescribed in aquas instruction
     
  46. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Yea, I can prepare a step by step guide for R.A.M later, but need the shader from Bart first. :D
    It actually should be easier to modify than aquas, as ram is a surface shader.
    You could take a look in EnviroTransparent shader. You mostlikely only need to add the enviro fog include, copy paste the ApplyFog function and add the finalcolor:ApplyFog to the surface shader pragma.
     
  47. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Ok great :) It seems easy but I'm not programmer soi will wait for iunstruction ;)
     
  48. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Thanks for the update :) Does it include a skybox Color Option in an interior / Underground preset already?
     
  49. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Okay, here is the guide to modify R.A.M Rivers for enviro.
     

    Attached Files:

    Mark_01 likes this.
  50. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Yea, I included skybox color option. :)
     
    Firlefanz73, KRGraphics and P_Jong like this.