Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Thanks for that. Probably exactly what I'll go for.
     
  2. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Hi,
    i am new to game dev and never heard of SSMS, but it looks very nice, how expansive is it performance wise ?

    br
    Funkeys
     
  3. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Shouldn't be that expansive. Just try :) You also could add a option in your graphic settings to let your players choose.
     
    Funkeys likes this.
  4. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Currently working hard on next update!
    My goal for 1.9.0 is to improve workflow of Enviro. Enviro now uses scriptable objects for a global profile and weather presets. That will allow to tweak the settings in play-time without loosing your changes when back in design-time.

    You can quickly create new profiles and assign to EnviroSky in your scene now. All textures, cloud layer confgs, gradients and curves are filled in for you to quickly start. Same for new weather presets.

    I also created custom inspectors for EnviroSky, EnviroZone and Weather Preset components to improve usability.

    Here are a few screenshots of new inspectors: (Still WiP!)

    upload_2017-6-21_18-39-38.png

    upload_2017-6-21_18-40-2.png

    upload_2017-6-21_18-40-40.png
     

    Attached Files:

    Teila, evilangel89, one_one and 5 others like this.
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I can't seem to edit the direct light intensity curve via script
    EnviroSky.instance.Lighting.directLightIntensity.keys[2].value = 2f;
    for example. I've tried storing it as a temporary value etc...?

    Long story short, I'm trying to bypass the weather system entirely to gain manual control of everything. I've got the clouds and rain and sky wave length under control. But I can't seem to get the light to do what I want. Some step I'm missing that's not letting me rear various settings >_> ?

    Like, is there a way to just not have a weatherprefab in action? I'd like to just have the cloud layers and rain and various color settings there and let me adjust them on my own via script.

    Also, is there a way to input time without using seconds? I'd like to have a 0-24 float or 0-1 float or something. There only seems to be integers, I guess I could wrap a second counter to a FixedUpdate, thought I'd ask though.

    ps: while you're updating. You misspelled Strength in a number of places as strenght =D
     
    Last edited: Jun 22, 2017
  6. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420

    Hi malkere,

    without changing the code it isn't possible to have no weather preset active. All the values you want to adjust with your script are public, so you maybe can try to update them but make sure to do this right after enviro. But haven't tried that yet.

    It looks like you can't modify the existing keys with new value. Wasn't working for me too.
    So for changing the light intensity curve try something like this:
    Code (CSharp):
    1.  
    2. AnimationCurve light = new AnimationCurve();
    3.  for (int i = 0; i < EnviroSky.instance.Lighting.directLightIntensity.keys.Length; i++) {
    4.    Keyframe k = new Keyframe ();
    5.    k.value = EnviroSky.instance.Lighting.directLightIntensity.keys [i].value + 1f;
    6.    k.time = EnviroSky.instance.Lighting.directLightIntensity.keys [i].time;
    7.    k.inTangent = EnviroSky.instance.Lighting.directLightIntensity.keys [i].inTangent;
    8.    k.outTangent = EnviroSky.instance.Lighting.directLightIntensity.keys [i].outTangent;
    9.    light.AddKey (k);
    10.    }
    11.  EnviroSky.instance.Lighting.directLightIntensity = light;
    12. }
    To set the time of day (0f-24f) you can use this function:
    Code (CSharp):
    1. EnviroSky.instance.SetInternalTimeOfDay(float Time);
    Yea there are quite a few typos. I will go trough code and fix all I can find. Thanks for reporting!
     
    Last edited: Jun 22, 2017
  7. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Thanks for the suggestions, I'll try plugging these in. Currently what I've done is to just remove all but the Rain2 WeatherPrefab from the zone, so I always start with index 0, it, and it can't go to any other index. That way if I change any of it's settings, or any of enviro's setting it always affects what's happening right now. Working so far, just getting started with it though.

    By the way, you're cloud maps are just a high res normal map, yes? In other words we should be able to plug-in some fun cloud layers with procedural textures, etc, right? I want to try playing with that someday here, just a thought for now though.

    edit: looks like they're both working now =] thanks
     
    Last edited: Jun 23, 2017
  8. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I've got the weather update going nuts. fyi, I'm running without my own scripts, just enviro right now. I set the weather update interval to 1, and if it goes off it doesn't stop going off, changing weather every frame.?

    Setting the update interval to 2 stopped it.
     
    Last edited: Jun 23, 2017
  9. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Thanks for your report! Will add fix in next update. If anyone need this now, contact me :)
     
  10. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm still getting stars at noon also. The stars curve is at 0 between 0.3 and 0.8, but they are visible over the blue sky? =o
     
  11. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    And after 0.8? You want to make sure that it is zero at 0.8+ too ;) Something like this:

    upload_2017-6-23_16-36-1.png
     
  12. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Ah, thanks. So that's the sun position? The tooltip says "time of day"
     
  13. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Vondox recently updated to Enviro 1.8.1 on Unity Pro 5.6.1p2 the screen still moves in the background but it might have something to do with Steam's VR prefab specifically the orthographic mode.. if I change the camera (eye) to orthographic it fixes/stabilizes the sky in VR but the clouds and blue sky is missing.
     
  14. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Oops, not all tooltips are updated yet. Sorry!
    Since 1.8.0 all curves and gradient using the sun position, expect the moon color gradient this is using moon position.


    Currently working on a fix for SteamVR. Should be finished and tested in the next days. I can send you package when it's ready so you don't have to wait for unity review.
     
    Last edited: Jun 24, 2017
    Ascensi likes this.
  15. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Why is my moon visible as a black sphere in daytime ?
     
  16. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi unicat,

    hard to tell, this should not happen. Maybe check your layer setup, enviro need two free layers.
    Defaults: (30 for clouds and 31 for satellites/moons).

    Make sure that the moon is using the correct layer (sat layer). Normaly this should be set by enviro on startup.
     
  17. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    I think my layers are correctly set. Shoud the moon mesh renderer be off?
     
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    No, the mesh renderer should be enabled.
    Maybe also check your cameras and exclude the two enviro layers. Also maybe check the enviro demo scenes to check if the issue is only in your scene.

    If nothing help: Please send a mail to vondox@live.de with screenshots of your camera and envirosky component.
     
  19. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Ok, testing further. Thank You.
     
  20. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    CTS - The Complete Terrain Shader was released today!
    This shader will bring your terrain to the next level and it got stunnishing weather effects aswell!



    This new integration component will synchronize enviro weather and season with your CTS shaded terrain.
    It will be included in next enviro update but I don't want to let you wait any longer, that's why I want to give it to you right now!

    How to use:
    1. Download and add the EnviroCTSIntegration.cs to your project.
    2. Add the CTS Weather Manager to your scene. "Component" -> "CTS" -> "Add Weather Manager"
    3. Now add the EnviroCTSIntegration component to the EnviroSky object in your scene.
      "Component" -> "Enviro" -> "Integrations" -> "CTS Integration"

    I am sure you will love it!
     

    Attached Files:

    Last edited: Jun 26, 2017
  21. chiefarchon

    chiefarchon

    Joined:
    Jun 22, 2009
    Posts:
    80
    Im looking into an environment packaga and would like to know, does Enviro support:

    • Multi-terrain
    • Infinite worlds
     
  22. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Sure you can use enviro with infinite worlds and multi-tile-terrains.
     
    chiefarchon likes this.
  23. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I use enviro with a multi-terrain infinite world
     
    P_Jong, chiefarchon and Vondox like this.
  24. chiefarchon

    chiefarchon

    Joined:
    Jun 22, 2009
    Posts:
    80
    Excellent
     
  25. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212

    wish there was a way to darken the fog over distance or have it blend better with the sky somehow...
     
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    This is builtin unity fog, right?
     
  27. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    You know I never really asked you about that... Doing too many things at once *_*

    That is unity linear fog with Enviro managing the colors only I guess, and the ranges with weather prefabs which I changed. In short my background camera is rendering a 1/16th scale world so I have onPreRender for that camera dividing the fog by 16 to make it look blended, you can see the separation pretty clearly 2km out in that picture. where the trees stop and the color is a little off. Do you think I could get that working with your advanced fog for better results?
     
  28. chiefarchon

    chiefarchon

    Joined:
    Jun 22, 2009
    Posts:
    80
    I hear you can set up "funky alien skies", so is this scenario possible and how easy to set up:

    • No actual sun or moon
    • red-ish glow in to the east looking like the sun has forever just gone below the horizon
    • blue glow to the west looking like the sun is forever about to rise
    • There are certainly clouds and weather conditions
    • night time does happen but not very much or for very long
    • the red and blue glows in the sky shift so that one or other is more dominant.
    • The general colours on the worlds surface are not different from our own, regardless of the look of the sky. For instance everything does not have some red or blue hue or anything like that.
    so the above is just a wish list thing and not a deal breaker. But how difficult is that to accomplish with Enviro
     
    Last edited: Jun 28, 2017
  29. chiefarchon

    chiefarchon

    Joined:
    Jun 22, 2009
    Posts:
    80
    Hi there

    Unity 2017 is due out in July, but betas have been available for testing.

    • Have you had a chance to test Enviro on the Beta?
    • Will Enviro be ready for the Unity 2017 release?
    I would like to use your product in my new project but I will hold off from starting till Unity 2017 is released as I have heard that upgrading a project can be difficult at times and I want to avoid this for as long as possible.
     
  30. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Had a couple questions before purchasing. :)

    • How is performance? I have been using Tenkoku but it is very performance heavy (Base scene: 500 fps, With Tenkoku: 150fps) and I need something that is much lighter for the scope of my project.
    • Events are noted, how do they work? Is there OnHour(), OnMinute(), etc? Are they UnityEvents?
    • How does the network sync work? Do you use a simple RPC call?
    • What are your plans for the next year or so?
     
  31. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi,

    Very nice asset, i love it but i having a problem, i get this black hemisphere "hat" thingy, both inside and on the skybox:
    http://imgur.com/a/29lwc
     
  32. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi,
    sorry that you have issues with enviro! Are you using deferred rendering? There is a bug that will be fixed in 1.9.0. But it is strange that you getting this inside your house?!

    Please try this:

    Open EnviroSky.cs and search for this line:
    Code (CSharp):
    1. PlayerCamera.hdr = HDR;
    and change to:
    Code (CSharp):
    1. PlayerCamera.hdr = true;
    Please send me a mail (vondox@live.de) with more information like unity version and screenshot of your camera components if this fix doesn't help.
     
  33. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi :)

    Okay first enviro is working great in Unity 2017.1.0f1! Just tested that ;)

    About your alien sky:

    You got plenty of options to change the look of sky and you are able to tweak direct and ambient light settings with a color gradient based on current sun position. You also can deactivate the moon or setup the sundisk to vanish. To stop the sun movement you may have to do a small code change, but this should be really easy.
    But I am not absulutly sure if you could setup the sky to be blue in west and red in east. I just haven't tested this. At the end enviro skybox calculating atmospheric scattering based on formulars that will work for our planet. But you are free to weak the values to get something completly different.

    If you can't get the sky look exactly the way you need, you just could use your own skybox material and still have clouds and weather. Just assign the material and set skybox mode to custom skybox.

    Here are the settings for sky rendering:
    upload_2017-6-28_18-7-1.png
     

    Attached Files:

  34. chiefarchon

    chiefarchon

    Joined:
    Jun 22, 2009
    Posts:
    80
    Again thank you, I shall be purchasing Enviro on friday and look forward to using it. I am expecially interrested in its localised effects too.
     
  35. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi,
    thanks for your interest in enviro!

    Performance:
    Enviro can be tweaked to be really fast, even on older gpu's! Here is a screenshot with "Cloud Quality Mode" set to "Low" (This setting controls the resolution clouds are rendered, they will be upsampled in SkyFinalize shader later).
    All other settings are on default.
    At the end it is really hard to see a difference between these modes but the performance gain can be massive!
    (My Rig: i5 3570k @3.4Ghz, Amd R9 285 3GB)
    upload_2017-6-28_18-28-28.png

    If this is still too slow you can tweak each cloud layer quality to gain even more performance, but this will influence the visuals a little bit. All these settings can be changed on runtime, so you can easily add a graphics options menu.

    Events:

    Enviro uses c# events and delegates. You can add your actions through inspector or inside your scripts. Here is a screenshot of the event component:
    upload_2017-6-28_18-35-41.png
    If you take a quick look into the documentation (last page) you see the code how to listen on events in your own scripts.
    Oh but there is no OnMinute event currently, but I could add this if you really need it.

    Network:
    Enviro supports UNet out of the box. You got two components one for your clients and one for the server part (this component is active on both server and clients and does a check isServer).
    When a client login the client will request [Command] weather and season from server. After that the server only will send an RPC to your clients if weather in a zone or the season changes.
    The time will be synchronized using [SyncVar] and a smoothing lerp will be applied on clients.
    You also got a option for headless server, in this mode the server only will calculate time, weather and season, and skip all other features of enviro. A network sample scene is included to see the correct setup and get you started.

    Plans:
    I am currently working on next big update. This will include a profile system and weather presets using scriptable objects. It also will include some nice looking custom Inspectors. My goal in this update is to improve the workflow with enviro.
    After that I wanted to create a second cloud shader to render more realistic high altitude cloud you can mix with the volumetric looking ones. I am open for feature requests after 1.9.0 is released.
     
    Last edited: Jun 28, 2017
  36. the_genius

    the_genius

    Joined:
    Mar 24, 2014
    Posts:
    7
    Hello,

    I've just started using Enviro in my game as a replacement for Time of Day (as it looks much better in my scenes). So far i've been very impressed. But, i've noticed one small bug where the lighting jumps as the sun is setting.

    The problem is when the sun sets and the 'Direct Light' jumps from the sun to the moon, the scene instantaneously gets brighter when it should be getting darker. The intensity on the light seems to decrease, but I think the angle might be changing making it brighter.

    I've been able to reproduce it on the WebGL demo scene too. If you play the scene then at around 19:20 it suddenly gets lighter when it shouldn't.

    Is there an easy way to fix this?

    (I haven't been using Enviro for long yet so i haven't had time to look through all the settings or read this forum in depth. Sorry if i'm repeating something which has been asked before)
     
  37. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi,
    okay this is something we only can reduce. The problem is that we really only want one directional light in our scene. Otherwise it would kill you performance in big heavy scenes with a lot of objects.

    So how to reduce the noticable jump:

    Take a look in EnviroSky Lighting category and open the "Direct Light Intensity" graph:

    You now want to decrease the light intensity when the sun travels near the horizon. This is at the middle of the graph (time: ~0.5). So try to modify your graph to look like this:

    upload_2017-6-28_19-19-1.png


    Hope that will help you :)
     
    the_genius likes this.
  38. the_genius

    the_genius

    Joined:
    Mar 24, 2014
    Posts:
    7
    Thanks for the quick reply!
    It's looking much smoother now.
     
    Vondox likes this.
  39. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Nice, I will add this change to the default profile setup in 1.9.0.
     
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Great asset. I've owned almost every sky system thats been in the asset store over the years and I am so happy that you got the clouds right, an area that the majority of systems never managed.

    When you are fixing things for the next release, perhaps you could fix the typo in the demo GUI - one of the sliders is labelled 'Simulated Day Lenght' instead of Length.
     
  41. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    A similar typo in one of the scripts variables that shows up in the editor inspector - Enviro Sky script, Lighting section, 'Shadow Strenght' instead of Strength.

    Oh and another one - same script, Sky section, under Scattering, 'Wave Lenght'.

    And one more for luck - Same script, Clouds section, under Clouds Wind Animation, 'Clouds Wind Strenght Modificator'.
     
  42. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi elbows,

    thanks, I am happy to hear that you like enviro :)

    Hehe, yea this "ht" typo is allover my code :/ Sorry for that, but I already fixed these in 1.9.0 and some more aswell.

    Anyway thanks for mentioning the UI, that one is still missing ;)
     
  43. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    About using scriptable objects, I hope you're setting up scriptable objects in a way that profiles can be applied runtime modification, but without altering the scriptable object after the game :)

    For instance let's say you have an Item class as a scriptable object. If you get these scriptable objects into a List<Item> and do any modifications on the list items, I am pretty sure the scriptable objects also get these changes, so when you come back to the game, these changes persist which sucks for some scenarios.

    Instead what I usually prefer is to use another class ItemReference or ItemProxy and have it contain the same set of attributes in it. So basically from List<Item> I create a new List<ItemReference> and make the whole program work on List<ItemReference> .

    Sorry if I am talking about something very basic here ^_^b
     
    Vondox and one_one like this.
  44. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Yup, creating copies after loading the scriptable objects should do the trick. As long as these contain simple data types, that should be fairly straightforward.
     
    Vondox likes this.
  45. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I took some high resolution screenshots and noticed that the background camera is not up to resolution. I see the code is setting the resolution of the render texture at the start, and probably not after that? I tried forcing it to a higher res:

    Code (CSharp):
    1. BackgroundRendering.bgRenderTex = new RenderTexture (1980, 720,16,format);
    Does that make sense? It doesn't seem to have helped... I'm using the free "instant screenshot" script from the store.

    edit: ill bet the screenshot script is to blame.. already in bed tho
     
    Last edited: Jun 29, 2017
  46. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Good point :)

    Sure when you hit the "Apply" button all classes from the profile will be applied/copied to the envirosky control script.
    Enviro uses the cloned settings not the profile settings now. So you are free to modify these in runtime in your scripts without altering the actual profile.

    Currently I use JsonUtility to copy the classes:

    Code (CSharp):
    1.     public void ApplyProfile(EnviroProfile profile)
    2.     {
    3.         skyRuntime = JsonUtility.FromJson<EnviroSkySettings> (JsonUtility.ToJson(profile.skySettings));
    4.         ...
    5.     }
     
    Last edited: Jun 30, 2017
    one_one likes this.
  47. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Here are some screenshots showing the ui for editing settings on envirosky component.

    upload_2017-6-30_6-28-7.png upload_2017-6-30_6-29-17.png

    "Save to Profile" will save all settings to the currently assigned profile.
    "Load from Profile" will load all settings from the assigned profile.
     
  48. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Yay ^_^b
     
  49. MikeReaLight42

    MikeReaLight42

    Joined:
    Jul 3, 2017
    Posts:
    1
    Hi,

    I've just started using Enviro, so maybe this is a trivial problem, but I have not found a solution. All sprites and UGUI, when it's rendered in a camera or world space, have wrong depth if rendered above the sky.
    http://imgur.com/MhbfuRA.png
     
  50. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,420
    Hi,

    sorry, haven't seen that before and need to check that on my side. I will contact you with a fix later.