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

    Kin0min

    Joined:
    May 12, 2015
    Posts:
    8
    Hi Vondox, I was curious as to whether or not Enviro works with aerial views, or flying over/through the clouds?
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    No not out of the box, enviro clouds are designed and optimized to be viewed from lower levels. But you could use Fog Volume 3 with the enviro integration component.
     
    Kin0min likes this.
  3. Firlefanz73

    Firlefanz73

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

    two questions to make it even work greater :)

    I have "Bioms" in my game (just like in minecraft), every biom has unique Feature, for example in one biom it is always winter.
    Can I set Enviro to Winter manually for my winter biom, set Fall manually for my "dryland" biom etc and so on? Instead of using your build in Season automatically passing?

    When my Player is deep Underground, it should be as dark as in the night (or a bit darker). Diffuse Light is okay Underground, but how can I just lower the ambient light? Just set Rendersettings Ambient Light and Intensity to own value each Frame when Underground and do not set it "On air" or is there some Kind of reduction variable or something else in Enviro I should use to lower ambient lighting?

    Thanks a lot!
     
  4. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hello Vondox,

    i'm experiencing a shadow jitter with Enviro. Seems like the sun movement are not smooth which cause a shadow jitter on scene objects. any idea how i can fix this please ?

    Thanks
     
  5. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    upload_2017-9-18_17-41-22.png

    Does anyone have similar error when clicking cast shadows on cluds ?
     
    amynox likes this.
  6. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    You can deactivate the season calculations here: "Time And Location Controls" -> "Calc Seasons". Now you are free to change seasons with this function:
    Code (CSharp):
    1. EnviroSky.instance.ChangeSeason (EnviroSeasons.Seasons.Spring);
    But you may also want to setup new zones for your biomes to have unique weather in eah of them. Just create a new gameobject and add the EnviroZone component. Now scale the zone and add the weather presets you would like to see in that zone.

    For your underground lighting you may have to wait for next update. I will add a new option to easily modify the lighting in runtime and add a new component to smoothly switch between cave/underground -> open air lighting.
     
    Firlefanz73 likes this.
  7. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm, I don't see that on my side. What Unity version are you running? Do you have modified the unity shadow settings?
     
  8. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Thanks for reporting. I need to add a null check here. When you enable clouds shadows in runtime you have to click on "Apply Changes" button here:

    upload_2017-9-18_19-6-4.png

    This will recreate the clouds meshes and also create the clouds shadow mesh and material fixing your error.
     
    amynox and Rastapastor like this.
  9. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Ye i noticed after applying, the error is gone ;). Thanks for response





    Just wanted to say i love it. Though i use it less than one day and still have tons to dig in. So far i like it ;)
     
    Vondox likes this.
  10. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    1/ I'm using Unity 2017.1.1f1
    2/ I didnt change unity shadow settings (pic attached)


    3/ A made a quick video to show the issue =>


    Thank you for the help ;)
     
  11. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Okay I see. What are your camera near and far clipping planes at? Have you already tested enviro sample scene?
     
    Last edited: Sep 19, 2017
  12. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    I'm working on a top-down game.

    My camera is 17f (on Y) far from the ground with these clipping : near=0.1 far=50. I'm using Deffered rendering.

    Thanks
     
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Please try to assign your camera as player too. Sorry but I am currently not sure why shadows are jittering on your side. Do they only jitter when sun moves/time passes? Do you see this in sample scene too?
     
  14. Yborshik

    Yborshik

    Joined:
    Apr 3, 2017
    Posts:
    4
    Hi again, what about multiple cameras script, is it possible? And one more question, how can I disable lightning flares in a buildings?
     
  15. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Sorry for the delay, but I haven't found time yet. I will work on that tomorrow and contact you as soon as possible.
     
  16. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hi Vondox,

    Thank you for your help. I managed to fix the shadow stutter by setting the camera near plan from 0.1 to 0.5 and that fix the issue.
     
    Last edited: Sep 19, 2017
    Vondox likes this.
  17. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Another quick setup with Enviro :)



    Dont mind the mountains, i just like them :D. Its what i produced this afternoon :).
     
    Vondox likes this.
  18. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    As far as I examine, Enviro is really great!

    I would use the included shaders (EnviroSurfaceShader) if they had a normal map strength slider. Right now it is too weak compared to my Standard opaque shader....

    And my wish for the update would be a light Setting for Underground and In Building :)

    Thanks. Great stuff. Love to Play around with it.
     
    Last edited: Sep 19, 2017
    Vondox likes this.
  19. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Okay I have it done :) Oh btw for your lightning issue you most likely just want to enable shadows on the "Lightning" object that is parented to EnviroSky prefab.

    Here some screenshots:
    upload_2017-9-20_8-7-47.png

    upload_2017-9-20_8-28-20.png

    Please note this is not a perfect local coop implementation with some limitation. But should be pretty much usable in limited, smaller maps.
    The setup is pretty easy: Just add the "EnviroMultiCamera" component to your other cameras and set an unique player name id.

    upload_2017-9-20_8-31-36.png

    Limitations:

    - Only first player can trigger zones.
    - There is still only one clouds mesh that will move with first player. Other players won't notice when first player move in a decent range, but once the first player is far away the clouds viewdistance for other players will be decreased.
    As workaround use a decent viewdistance + high clouds world scale. This will give you a much wider roam area before the sideeffect becomes too noticable.
    - The weather particle effects are moving with first player too. Make sure to make the particle effects area big enough to have weather particle for all your players.

    This is all I was able to get done quickly. For proper local coop support that will work in really big open worlds a lot of rewritting and redesigning would be needed. We would need clouds meshes for all players each with ther own layer. Same for moon / satellites. And we also would need a set of particle effects with unique layer for all player too. The trigger system would need some rewriting too of course. At the end we would need 12 unique layers for 4 local players.

    I will send you the package and hope that you find it usefull for your project. :D Everyone else can contact me to get this too. I don't want to post it here as I needed one little change in main script to get it working.
     
    Last edited: Sep 20, 2017
  20. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    I think i am stupid, where can i find wind settings in Enviro ?
     
  21. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Cloud category in profile and weatherprofiles. ;)
     
  22. russnash37

    russnash37

    Joined:
    Feb 22, 2017
    Posts:
    31
    Hi and thank you for this great asset!

    I'm having an issue with EnviroSky 1.9 constantly throwing the following error:

    Code (csharp):
    1.  
    2. [Exception] UnassignedReferenceException: The variable fogMaterial of EnviroFog has not been assigned.
    3. You probably need to assign the fogMaterial variable of the EnviroFog script in the inspector.
    4. Material.SetTexture()    C:/buildslave/unity/build/Runtime/Export/Graphics.cs:713
    5.  
    6. Material.SetTexture()    C:/buildslave/unity/build/Runtime/Export/Graphics.cs:712
    7.  
    8. EnviroSky.UpdateAdvancedFog()    Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1541
    9. 1540:   if(cloudsCamera != null)
    10. -->1541:       atmosphericFog.fogMaterial.SetTexture ("_Clouds", cloudsCamera.targetTexture);
    11. 1543:   if(backgroundSettings.backgroundRendering && bgCamera != null)
    12.  
    13. EnviroSky.Update()    Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1351
    14. 1350:   if (Fog.AdvancedFog)
    15. -->1351:       UpdateAdvancedFog ();
    16. 1353:   // Update sun and fog color according to the new position of the sun
    17.  
    At first I though I was missing a variable assignment in the inspector, but cannot locate one called 'fogMaterial'. This doesn't seem to stop EnviroSky from working, but its perplexing nonetheless.

    Thanks for any assistance.

    Russ.
     
  23. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello I have a question because you system is creating box colider inside my player, and it makes block raycast from there, also it has rigidbody, ( I see there is ignore raycast layer but it seems dont work. ould you help me?
     
  24. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hi Russ,

    please try to remove all enviro related components from your camera. You also may want to reimport enviro if you still getting this error.

    Best Regards,
    Hendrik
     
    russnash37 likes this.
  25. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Could you please show me your raycast code? You may want to use a layerMask in raycasting that exclude the ignore layer.
     
    Last edited: Sep 22, 2017
  26. russnash37

    russnash37

    Joined:
    Feb 22, 2017
    Posts:
    31
    Thanks for the reply, Hendrik,

    Removing the enviro objects from the camera resolved the problem.

    Thanks again!

    Russ.
     
    Vondox likes this.
  27. Kalle801

    Kalle801

    Joined:
    Mar 3, 2013
    Posts:
    80
    Help please!


    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[EnviroZone].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    EnviroSky.OnEnable () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:452)
    UnityEditor.DockArea:OnGUI()


    NullReferenceException
    UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, Vector3 pos, Quaternion rot) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineObjectBindings.gen.cs:53)
    UnityEngine.Object.Instantiate (UnityEngine.Object original, Vector3 position, Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:156)
    UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original, Vector3 position, Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:206)
    EnviroSky.CreateEffects () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:972)
    EnviroSky.Start () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:440)
     
    Last edited: Sep 23, 2017
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Please try to reimport enviro from asset store and replace the EnviroSky prefab in your scene.
     
  29. Firlefanz73

    Firlefanz73

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

    I want to have a dark night. So around 0 o'clock nearly black.
    Except of this, lighting and Color is totally great as it is in Default Setup.

    I tried to set down as suggested values a lot, but nothing happens, it is still very light/bright night:

    Sky Luminence
    upload_2017-9-23_16-57-53.png

    Sky Color Power:
    upload_2017-9-23_16-59-49.png

    How can I Keep it like in the Defaults, only the night much darker, so it is nearly black at around 0 o'clock?

    Thanks a lot and have a nice Weekend!
     
  30. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    Hey all! Can't search this post for "ICE" because it's too short, which is the case for many assets. However, I am wondering if anybody has integrated with ICE Creature Control yet and doesn't mind sharing?
     
  31. Kalle801

    Kalle801

    Joined:
    Mar 3, 2013
    Posts:
    80
    I got it already working. I had 2 scenes with the same prefap lol
     
    Vondox likes this.
  32. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    These two curves are only for the sky rendering. For scene lighting you need to tweak the direct and ambient intensity curves and/or color gradients in lighting category. ;)
     
  33. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Thanks! How can I get my Default back for the sky after I saved the Profile in the scene's editor?
     
  34. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    You can create new default profiles with right click on a folder and then: Create -> Enviro -> Profile. After that you could save the curves or gradients you would like to have back to default as presets and apply them on your main profile.
     
    Firlefanz73 likes this.
  35. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Thanks a lot for the Support!

    One more question, I think it will be the last one for a longer time:

    I have a water shader. I Need a value between 0 and 1 for it's brightness.
    I tried RenderSettings.ambientIntensity but it does not Change it's value.

    Do I have to calculate it with the time or is there a brightness value I can use somewhere?

    Thanks again :)
     
  36. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    62
    Hey how can i get an ingame clock .. Does anyone know this?
    With enviro
     
  37. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    maybe i am wrong but there is static variables to access to hour
    Get current time:
    int currentSecond = EnviroSky.instance.GameTime.Seconds;
    int currentMinute = EnviroSky.instance.GameTime.Minutes;
    int currentHour = EnviroSky.instance.GameTime.Hours;
    int currentDay = EnviroSky.instance.GameTime.Days;
    int currentYear = EnviroSky.instance.GameTime.Years;
    float timeOfDay = EnviroSky.instance.internalHour;

    them you create script to control

    public class reloj : MonoBehaviour {

    public short hour = 0;
    public short minute;
    public short second;
    private GUIStyle guiStyle = new GUIStyle();

    public GameObject objeto1;


    void OnGUI() {

    //muestro en la pantalla la hora actual del juego
    hour = (short)EnviroSky.instance.GameTime.Seconds;
    minute = (short)EnviroSky.instance.GameTime.Minutes;
    second= (short)EnviroSky.instance.GameTime.Hours;
    guiStyle.fontSize = 30; //change the font size
    guiStyle.alignment = TextAnchor.LowerLeft;

    GUILayout.Label(hour+" : "+minute+" ." +second+" Dia:"+ EnviroSky.instance.GameTime.Days, guiStyle);


    }
    }
     
    Stefan86 and Vondox like this.
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Claudius_I solution should work but there are two function already implemented to get a time string. :)

    Code (CSharp):
    1.  
    2. string time = EnviroSky.instance.GetTimeString();
    3. string timeWithSeconds = EnviroSky.instance.GetTimeStringWithSeconds();
    4.  
     
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    I am not 100% sure if this is still the same in Unity 2017, but in Unity 5.5 and 5.6 the ambientIntensity only applies on ambient skybox mode. So you want to modify ambient lighting gradient and curve directly in enviro to tweak the ambient color in flat or tri-light mode. Check the lighting category in enviro profile.
     
  40. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    No, I want to set a value of my water shader which is 0 for dark and 1 for bright.
    I just ask myself, where from enviro I can get the "Overall brightness" value, I tried ambientIntensity but it does not work.

    Is there a value in enviro I can use to set my water brightness depending on the daytime Overall brightness?

    Thanks!
     
  41. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Ah okay sorry, please try this: EnviroSky.instance.GameTime.solarTime
     
    Firlefanz73 likes this.
  42. Freshmeat911

    Freshmeat911

    Joined:
    Nov 3, 2016
    Posts:
    79
    @Vondox How's the beta coming.
     
  43. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    hi Vondox

    how exactly work the script Enviro Terrain Vegetation?
     
  44. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hm that is not a real finished component for now. Didn't know that it is still included. :D

    Currently I would not use it but if you want to test make sure to copy and backup your terrain data!
     
  45. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Still a slot of work to do. Currently working on transparent support for fog and volume lighting. Enviro 2.0 will include transparent shaders and particle shaders with proper fog support out of the box. But you also can add fog support to your own shaders with about three lines of code later.
     
    Freshmeat911 and Bartolomeus755 like this.
  46. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Perfect! Thanks.
     
  47. Stefan86

    Stefan86

    Joined:
    Aug 31, 2017
    Posts:
    62
    [QUOTE = "claudius_I, post: 3232184, Mitglied: 1395277"] Vielleicht bin ich falsch, aber es gibt statische Variablen, um auf die Stunde zuzugreifen
    Aktuelle Uhrzeit:
    int currentSecond = EnviroSky.instance.GameTime.Seconds;
    int currentMinute = EnviroSky.instance.GameTime.Minutes;
    int currentHour = EnviroSky.instance.GameTime.Hours;
    int currentDay = EnviroSky.instance.GameTime.Days;
    int currentYear = EnviroSky.instance.GameTime.Years;
    float timeOfDay = EnviroSky.instance.internalHour;

    Sie erstellen Skript zu kontrollieren

    public class reloj: MonoBehaviour {

    öffentliche kurze Stunde = 0;
    öffentliche kurze Minute;
    öffentliche kurze Sekunde;
    private GUIStyle guiStyle = neue GUIStyle ();

    öffentliches GameObject objeto1;


    void OnGUI () {

    // muestro en la pantalla la hora aktuelles deljuego
    Stunde = (kurz) EnviroSky.instance.GameTime.Seconds;
    Minute = (kurz) EnviroSky.instance.GameTime.Minutes;
    second = (kurz) EnviroSky.instance.GameTime.Hours;
    guiStyle.fontSize = 30; // Ändere die Schriftgröße
    guiStyle.alignment = TextAnchor.LowerLeft;

    GUILayout.Label (Stunde + ":" + Minute + "." + Zweite + "Dia:" + EnviroSky.instance.GameTime.Days, guiStyle);


    }
    }[/ZITAT]
    Super hat gearbeitet .. danke
     
  48. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! This looks good! A few question before buy..

    Is it easy to use with other assets, like for example a variable to show time in UI in upper corner of screen? Have enemy spawn with ICE creature control? Can I use with suimono water system?
     
  49. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,422
    Hello,
    there are two helper function to get a time string you could output to your UI. This is also shown in DemoUI script that is included in Enviro.
    Code (CSharp):
    1. string time = EnviroSky.instance.GetTimeString();
    2. string timeWithSeconds = EnviroSky.instance.GetTimeStringWithSeconds();
    Enviro - ICE Integration is planned for next ICE update. But I unfortunaly really don't know when this update hit the store. Oh and I know a few users using Suimono with Enviro, so it should work quite well, but currently can't test it myself.
     
  50. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    DemoUI so theres a hour & seconds in UI demo? Awesome! Im really considering this.. hows the FPS? Performance..overall?