Search Unity

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

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, please check your Unity physics matrix settings. Make sure that your zone object layer can interact with the EnviroSky object layer as the weather zones working with unity triggers.
     
  2. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, instead of setting:
    EnviroSky.instance.fogSettings.Fogmode
    you need to use this:
    EnviroSky.instance.fogSettings.useSimpleFog = true;

    For volumetric lighting:
    EnviroSky.instance.volumeLighting = false;
     
    Firlefanz73 likes this.
  3. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,197
    Thanks a lot :)
     
  4. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @Vondox Awesome. Thank you! I hate to bother you but now I'm getting this error:

    Assets/Plugins/Enviro - Dynamic Enviroment/Scripts/AQUAS Integration/EnviroAquasIntegration.cs(23,10): error CS0246: The type or namespace name `AQUAS_LensEffects' could not be found. Are you missing an assembly reference?

    I'm very confused because the AQUAS_LensEffects script exists in the Aquas scripts folder and it is public and without a namespace (as you know) so I'm not sure what is preventing the Enviro script from accessing it like this:

    private Aquas_LensEffects aquasUnderWater;
     
    Shylos likes this.
  5. RyanDunne

    RyanDunne

    Joined:
    Mar 30, 2017
    Posts:
    13
    Thank you for the reply, that would be awesome :)
     
    mikedelves likes this.
  6. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    ok, thanks, I'll test it then.
     
  7. Spartikus3

    Spartikus3

    Joined:
    Dec 27, 2013
    Posts:
    46
    @Vondox I have been using your asset for a couple of days. First off well done. A scrub like myself managed to jam it into uMMORPG and it kind of worked out of the box :)
    Question:

    In -batchmode -nographics on a standalone windows 7 box running my server two things happen:
    1) once a player connects to the server even though the server is in batchmode no graphics the server starts playing the audio FX locally on the server :) They come through my speakers when I am remoted into the server box watching the performance monitor. Bizare.
    2) ( and the more serious issue I am having ) Is I get this error in the server log
    RenderTexture.Create failed: format unsupported - 9.
    (Filename: Line: 430)
    Over and over again and it appears to be causing a memory leak for the scene as the memory usage goes up by 2-4k every couple of seconds.

    I tried running the server locally on my coding machine and no errors when I connected to it with either a stand alone client or the editor client. This only happens when I run it on my dedicated win7 "server" box.

    Any thoughts as to what I could be running into?

    Thanks in advance! (And just to be clear.. I dont think this is a problem with your asset at all, jsut my clumsy attempt at integration)

    PS: More details.
    - Running the scene in windowed mode on the standalone server with no connections to the box i dont get the error but th ememory leak is definitely there and useage is oign up by 100k every second or 2.
     
    Last edited: Oct 4, 2018
  8. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello,
    do you already use the EnviroSky.instance.StartAsServer() function on your headless server? Please try it if you haven't done that yet.

    About the memory leak:
    I don't see a memory leak on my side. Maybe we could connect through skype and have a look into your setup together? Send me a private message with your skype username if you got some time for debuging.
     
  9. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    393
    Hello I have problem with enviro in my build. First Of all I will add that I use asynchrous additive load but all elements that needs enviro are on one scene. The Problem is that after load scene in build, first of all whole sky is darker, All clouds looks very flat (volumetric clouds) and flat clouds are invisible There is no flat clouds in build. Overall it looks very very poor according to editor playmode, also it seems like voluemtric light also isnt working. Are there any special settings of player or any unity setttings that We should set before building game? Is there any documentation other that that http://warlords-destiny.com/Enviro_Documentation.pdf cause it very very poor! :) EDIT: after making some more test it seems like loading level with enviro in additive or asynch additive way makes thatt flat clouds dont appear also it seems like this is problem in editor too




    My second question is, About realtime Global Reflection update Lower number there means lower number of updates per second? or higher?
     
    Last edited: Oct 4, 2018
  10. Spartikus3

    Spartikus3

    Joined:
    Dec 27, 2013
    Posts:
    46
    Lol of course I didn't use start as server ;) That would mean I paid attention to instructions.. is there documentation somewhere that shows me where I should call that Vondox? Would it be appropriate on scene load?

    Thank you for the offer to look deeper into the mem leak. I suspect it has more to do with the server instancing. Let me resolve that before I impose on your generous offer.

    Thank you sir! Looking forward to using this more.
     
  11. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    393
    Just image to my earlier post

    Also I tested more problem occurs when Loading scene in asynch way, even if this is only one scene. If loading it in standard way it works, Could check it out and let us know how to fix that, strange that that problem occurs only with asynch additive mode) (I check only single didtn check additive no asynch)
    upload_2018-10-4_20-51-6.png
     
    Last edited: Oct 4, 2018
  12. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hi Jakub,

    sorry I can't reproduce that on my side... If I understand correctly you start in a scene without enviro and load a scene that includes the envirosky prefab in async additive way?

    I tried this:
    SceneManager.LoadSceneAsync(1,LoadSceneMode.Additive); But volume and flat clouds are showing up like they should on my side.

    Could you please provide me a sample project to debug?

    For volume lighting: You have to add the Enviro/VolumeLight shader to the list "Always Included Shaders" in Unity -> Graphics settings. Please check the documentation that is included in package not the on the old link.
     
  13. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    393
    I sent you some Private Message with some more info. Hope you could help
     
  14. Spartikus3

    Spartikus3

    Joined:
    Dec 27, 2013
    Posts:
    46
    Vondox I put that line in the player.cs.. Thank you sir. Initial assesment shows both the mem leak and the missing texture errors are dealt with. Many thanks!

    I have one further glitch I would like to resolve. The night cycle doesnt show the star background just the bluesky skybox with black clouds rolling across. I am sure it is something else I missed. My thanks again
     
  15. Muravu

    Muravu

    Joined:
    Nov 30, 2014
    Posts:
    48
    upload_2018-10-5_14-56-41.png
    Hey,
    I don't know why i keep getting these null references.When i start the project for the first time and download the asset, it seems to work fine , but after a while of playing with it (not changing any crucial settings) i get this.
    If anyone knows how to resolve this issue let me know, thanks.
     
  16. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hi, haven't seen this before. Please try to delete the EnviroSkyRendering component from your camera and restart your scene.
     
  17. Muravu

    Muravu

    Joined:
    Nov 30, 2014
    Posts:
    48
    Did that multiple times.
    I've also tried replacing the camera, scripts with no success
     
  18. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Okay, :( What Unity version and platform/rendering api do you use?
     
  19. DocQ

    DocQ

    Joined:
    May 30, 2013
    Posts:
    11
    I followed these instructions trying to network Enviro with uSURVIVAL game. It uses Mirror instead of unity networking, so I switched that in step 2 script. At step 3 I do not see a 'enviro player component' to add to my player prefab. Could you help please? Great product!
     
  20. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, you need to modify the EnviroUNetServer and EnviroUNetPlayer to work with Mirror Networking. You also have to use both scripts to properly work. I can have a look into these later and send you some more detailed instructions later.
     
  21. Spartikus3

    Spartikus3

    Joined:
    Dec 27, 2013
    Posts:
    46
    I am going to tackle synchronization using Mirror as well Vondox. If there is a way to get your adjusted scripts when you are done please let me know. Thanks. (Not a pressing issue for now working well enough)
     
  22. thunderdawn

    thunderdawn

    Joined:
    Sep 30, 2017
    Posts:
    34
    Hi! Thanks for the asset! If you could please help me with some settings. I'm looking to create a stylized polar night, meaning a very bright, colorful night and then more night. The day/night circle will consist of 24 hours of night.

    I ran into 2 problems, first obviously the lack of day, I can change the sun directional light to dark blue but the day skybox has no stars and galaxy. The second problem is when I set the moon brightness high, I end up with too much moon glare. I prefer to hide the moon texture because it's not too high res and I don't have much fog in the scene, so as a result it looks weird like a super bright spot in the dark sky. Is there a way to make a bright night in a more ambient style, so that the light comes from atmospheric scattering like during the day? I love the thick atmospheric look during daytime with volumetrics so if I could imitate it during the night too? Maybe some trick to turn day into a night instead?
     
  23. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    Hi, I've tried to add the Enviro Clouds Reflection component on the reflection camera of the Ultimate Water System.
    But there still is no cloud reflection shown:
    upload_2018-10-8_11-58-30.png

    other reflections are correct:
    upload_2018-10-8_12-0-25.png
    But no clouds

    Any further instructions?
     
  24. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, sure I will send the Mirror networking version to you too when I am done. :)
     
  25. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, okay Í would set this up like this:

    1. Set your "Latitude" to "-90" and day to something around "125". That shoud give you a whole night cycle. ("Time and Location Controls" section)
    2. If you still want to have a full moon here you need to set the "Sun and Moon Position" to "Simple". ("Edit Profile" -> "Sky" category)
    3. If you want to have night sky more blueish you could change the "Sky Luminence" curve to a straight line with values around "1".
    4. For volume lighting you just need to increase the "Scattering Coef" and decrease the "Extiction Coef". Maybe also set a low "Anistropy".

    It should look like this:

    upload_2018-10-8_12-4-53.png
     
    thunderdawn likes this.
  26. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hi, hm that should be all and working fine, but I never tesed this with UWS as I don't have a copy. Could you please check if that is the right camera? Does it assign a "Target Texture" in runtime? Maybe it is only a dummy camera and does hide the real one?! Sorry not sure. :D
     
  27. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    It does not assign a target texture, and the camera is disabled.
    Seems like a dummy camera, but I'm not familiar with reflection rendering methods, donno how to find the real one
     
  28. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Please check the scripts of UWS is there something that is named like Planar Reflections?
     
  29. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    Yes, there is a plannar reflection class.
    And there is a method called RenderReflection in this class.
    Here are the scripts of this method:
    Code (CSharp):
    1.         private void RenderReflection(Camera camera, Camera reflectionCamera)
    2.         {
    3.             reflectionCamera.cullingMask = _Data.ReflectionMask;
    4.  
    5.             SetCameraSettings(camera, reflectionCamera);
    6.  
    7.             _CurrentTarget = GetRenderTexture(camera.pixelWidth, camera.pixelHeight, reflectionCamera);
    8.             _TemporaryTargets[camera] = _CurrentTarget;
    9.  
    10.             var target = RenderTexturesCache.GetTemporary(_CurrentTarget.Texture.width, _CurrentTarget.Texture.height, 16, _CurrentTarget.Texture.format, true, false);
    11.             reflectionCamera.targetTexture = target;
    12.  
    13.             reflectionCamera.transform.eulerAngles = CalculateReflectionAngles(camera);
    14.             reflectionCamera.transform.position = CalculateReflectionPosition(camera);
    15.  
    16.             float d = -_Water.transform.position.y - _ClipPlaneOffset;
    17.             Vector4 reflectionPlane = new Vector4(0, 1, 0, d);
    18.  
    19.             Matrix4x4 reflection = Matrix4x4.zero;
    20.             reflection = Reflection.CalculateReflectionMatrix(reflection, reflectionPlane);
    21.             Vector3 newpos = reflection.MultiplyPoint(camera.transform.position);
    22.  
    23.             reflectionCamera.worldToCameraMatrix = camera.worldToCameraMatrix * reflection;
    24.  
    25.             Vector4 clipPlane = Reflection.CameraSpacePlane(reflectionCamera, _Water.transform.position, new Vector3(0, 1, 0), _ClipPlaneOffset, 1.0f);
    26.  
    27.             var matrix = camera.projectionMatrix;
    28.             matrix = Reflection.CalculateObliqueMatrix(matrix, clipPlane);
    29.             reflectionCamera.projectionMatrix = matrix;
    30.  
    31.             reflectionCamera.transform.position = newpos;
    32.             Vector3 angles = camera.transform.eulerAngles;
    33.             reflectionCamera.transform.eulerAngles = new Vector3(-angles.x, angles.y, angles.z);
    34.  
    35. #if SKYBOX_CLEAR_BUG_FIX
    36.             Graphics.SetRenderTarget(target);
    37.             GL.Clear(true, true, new Color(0.0f, 0.0f, 0.0f, 0.0f));
    38. #endif
    39.  
    40.             reflectionCamera.clearFlags = _Data.ReflectSkybox ? CameraClearFlags.Skybox : CameraClearFlags.SolidColor;
    41.  
    42.             if (_Data.RenderShadows)
    43.             {
    44.                 GL.invertCulling = true;
    45.                 reflectionCamera.Render();
    46.                 GL.invertCulling = false;
    47.             }
    48.             else
    49.             {
    50. #if UNITY_5_5_OR_NEWER
    51.                 var originalShadowQuality = QualitySettings.shadows;
    52.                 QualitySettings.shadows = ShadowQuality.Disable;
    53. # else
    54.                 var shadowResolution = QualitySettings.shadowResolution;
    55.                 QualitySettings.shadowResolution = 0;
    56. #endif
    57.  
    58.                 GL.invertCulling = true;
    59.                 reflectionCamera.Render();
    60.                 GL.invertCulling = false;
    61.  
    62. #if UNITY_5_5_OR_NEWER
    63.                 QualitySettings.shadows = originalShadowQuality;
    64. #else
    65.                 QualitySettings.shadowResolution = shadowResolution;
    66. #endif
    67.             }
    68.  
    69.             reflectionCamera.targetTexture = null;
    70.  
    71.             if (_UtilitiesMaterial == null)
    72.                 _UtilitiesMaterial = new Material(_UtilitiesShader) { hideFlags = HideFlags.DontSave };
    73.  
    74.             Graphics.Blit(target, _CurrentTarget, _UtilitiesMaterial, 0);
    75.             target.Dispose();
    76.         }
    77.  
     
  30. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I use this in one of my projects. It works though I have turned off the reflection probe usage in the water system so it only uses planar now. I wonder if there is a reflection probe that is overriding the planar?
     
  31. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166

    Okay cool, now please take a look if you find code where it instantiate the camera and add the EnviroCloudsReflection component to the camera here. Please also make sure that you only add one instance of the script by testing if it really isn't attached already. Tell me if you need help with that or send me the script in a private message for example.
     
  32. SveinEven

    SveinEven

    Joined:
    Sep 25, 2014
    Posts:
    99
    I've seen several questions for reflection of the sky in the water.
    What about reflection through a reflection probe.
    How can this be done?
     
  33. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hi, sky and flat clouds can be reflected by reflection probes just fine, but that won't work for volume clouds as they are rendered as post effect.
     
  34. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    I've already attached the EnviroCloudsReflection component on the reflection camera from the beginning, and it is on the camera in runtime. But there is no reflection.
     
  35. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    It is possible, for enviro's reflection probe does not contain the clouds in it.
    How do you achieve realistic lighting without reflection probe? I find the global lighting is tedious from day time to night time without reflection probe, everything got a white rim.
     
  36. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    387
    What's the status of HDRP?
    I'm perfectly fine with the HDRP extension costing something and alpha testing it. Shoot me a message if you're open for "early access"-ing it with paypal and a voucher later or something.
     
  37. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Okay, I think we have to meet in skype and investigate why clouds not showing up in UWS reflections then. Please send me a private message with your skype username.
     
  38. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, sorry it's still in work and will take me another few weeks to port it to the 2.1 branch. The 2.1 update with new lite/mobile version currently has priority. Then I will search for testers and you won't have to pay just for testing.
     
  39. thatscraigz

    thatscraigz

    Joined:
    Mar 27, 2015
    Posts:
    86
    Hi Hendrik :)

    I'm looking into purchasing but was hoping for some clarification.

    Would your asset work well with a top-down style game? I understand that most features (such as cloud cover etc) would probably need to be disabled, but is there any other sort of possible limitation? :)

    thank you,

    craigz
     
  40. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    387
    Cool! Tyvm
     
  41. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    Hey, @Vondox
    I find the skybox provided by enviro renders a pure black ground or a white ground color, this cause the reflection probe got inaccurate environment colors either too bright or too black:

    upload_2018-10-10_17-15-14.png upload_2018-10-10_17-15-58.png

    Is it possible to render the ground color according to the sky color and make it darker:
    upload_2018-10-10_17-18-35.png
    This kind of reflection probe gets the correct reflection on my character, otherwise the reflection looks either too bright or too dark.
    Is there any tricks I can use to get the ground color of the skybox more realistic?
     
  42. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Sure, enviro will work well in top down games too. You just need a perspective camera.
     
  43. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, for best results add your terrain layer to the reflection probe culling mask. But I also will add a color gradient for skybox ground color in 2.1 update.
     
    mmaclaurin likes this.
  44. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    Added terrain layer to the culling mask, but the center of the ground part is still the skybox's color. terrain color only surrounding it.
    And any estimated time for 2.1 update?
     
  45. CreativeEnd

    CreativeEnd

    Joined:
    Dec 3, 2017
    Posts:
    10
    I don't use enviro's built in reflection probe and I'm not at home to check, but it sounds like the probe is under the terrain. Try moving the probe up above the terrain surface.
     
    Vondox likes this.
  46. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, please check if probe is slightly under terrain. It should look like this:

    upload_2018-10-11_8-41-38.png

    Sorry, no estimate date for 2.1 yet, but you could join the beta testing. :)
     
  47. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    ah, so I should put the probe actually higher than terrainto get the correct probe. It should be positioned in the ground for now, I'll check the results.
    By the way, what are the ambient equator color and ambient ground color? Can't really see their effects when tweaking.
     
  48. RendCycle

    RendCycle

    Joined:
    Apr 24, 2016
    Posts:
    329
    Congratulations in being included in the 5 Great Assets for Beginners in Unity 2018, a review made by Sykoo on behalf of Unity!

     
    Last edited: Oct 25, 2018
  49. pablo102

    pablo102

    Joined:
    Jul 19, 2012
    Posts:
    10
    Hi there,
    I have a question about shadows. I've been watching your reel video and played with WebGL demo.
    It looks like the shadows are not affected by the clouds at all. There are harsh shadows on the ground with cloudy sky and even with fog, which is not realistic.
    Could you clarify on that, please?
     
  50. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,166
    Hello, yeah you are right. Currently there is no shadow modification based on weatherpresets. But that is a good idea and will be implmented in one of the next updatesw. Thanks! :)
     
    Dwight_Everhart likes this.
unityunity