Search Unity

Azure[Sky] - Dynamic Skybox

Discussion in 'Works In Progress' started by DenisLemos, May 1, 2015.

  1. JonasPersson

    JonasPersson

    Joined:
    Aug 14, 2016
    Posts:
    65
    It seems like i have to back down on this one....

    To update the Environment reflections in runtime doesnt seem like a thing you want to do....

    And if you have a huge reflectionprobe with importance 0, the blending with other probes seems to work ok. Maybe you already have written about this in the documentation and i missed it. If not put it in there so you get less questions from guys like me...
     
  2. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    @JonasPersson Hi, sorry to be late! I was doing some testing here.

    When you setup the reflection probes in your scene, imagine that all the probes are in a rendering queue, and the position of each probe in the queue is set by the importance value. If the importance value of one probe is equal to another, the position in the queue will be defined by the 'first-come-first-served' method.

    The importance of the sky controller reflection probe is set to the default value of 1. Then when you added the sky prefab to the scene, the sky controller reflection probe went to the last place in the queue. I think that's why the Sky Controller's reflection probe did not work well with the other reflection probes in your scene.

    To make the reflection probe of the sky controller work with the other reflection probes of the scene, it is necessary that:
    • The size of the sky controller reflection probe overwhelms the entire scene. Thus, when there is no other reflection probe covering the object, it will be influenced by the reflection probe of the sky controller.
    • The importance value of the reflection probe of the sky controller need to be less than the importance value of the other reflection probes present in the scene.
    • If you are using sky mode as a skydome, you need to add the skydome to some layer that is visible to the reflection probes' Culling Mask.

    Refresh reflection probes on every frame greatly impair performance. You do not have to update the reflection probes on every frame, as it is possible to update the probes via scripting only when there is some significant change in the scene.

    If you change the Refresh Mode of each reflection probe to "Via Scripting", the reflection probe will only update when calling the ReflectionProbe.RenderProbe() method.

    Thus it is possible to create a counter to update each reflection probe in time intervals. Or you can update the reflection probes only when there is some change in the lighting, or only when the camera is nearby.

    I prefer to set the update of the reflection probes via scripting, this way I have full control to manage when any probe needs to be updated.

    The AzureSkyController.cs script has the ability to refresh the prefab's reflection probe at time intervals, you can take a look at the code to find a starting point.
     
  3. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    45
    Hello,

    I am unable to use TAA post-processing with Azure. The PP layer is the last most thing attached to the Camera object, so it is not being rendered before Azure. I absolutely need Temporal AA for my game. I would appreciate any help that you can provide.
     
  4. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Hi!
    Sorry, but I could not quite understand your problem.

    But anyway, as you can see in the images below. The post-processing stack with Temporal Anti-aliasing effect is working normally in my test scene.
    Azure_TAA.jpg
    See the order that the components are attached in the Inspector of my camera.
    Azure_Camera.jpg

    Make sure you're using the latest version of the Unity Post-Processing Stack, since I've always used it with Azure in my tests and never had any problems.

    When MSAA is enabled in Quality settings, the post-processing profile shows this warning message.
    Warning.PNG

    If you have MSAA enabled then disable it because it might be the source of the problem. Although this does not make any difference to me, TAA continues to run smoothly in my test scene even with MSAA enabled.
     
    unity_dev3194 likes this.
  5. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    45
    Thank you so much for such a thorough response. Here is what I am experiencing:


    (You may need to click on the link to view it in full resolution)

    As you can see, there is a jitter / shimmer on the edge of the mountains.
    upload_2018-7-7_18-38-36.png

    Anti Aliasing is disabled under project settings.

    Also, it seems like you are using the previous Post Processing Stack (v1). I am using the latest one, v2 (available through the package manager). This is what v2 looks like (doesn't look like your post-processing profile). Maybe that is the source of the issue. Please let me know if you need any more images or gifs for a reference.
    upload_2018-7-7_18-40-29.png
     
  6. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    I am using the latest version 1.0.4 of the Post Processing Stack from the Asset Store, I did not know that version 2.0 had been released. I searched the Asset Store and did not find this new version, only in the v1.0.4 description has a link to the developing of v2.0 on Github.

    I installed version 2.0 of the Post Processing Stack under development on Github and I was able to confirm the same problem that you reported.

    For me, the problem was even worse, as the whole picture was flickering, not just the edges of the mountains as shown in your video.

    As version 2.0 of the post-processing stack is under development, I think the problem may be related to the new version because the current version 1.0.4 is running smoothly.

    It seems to me that the anti-aliasing of the new post-processing stack is also affecting the depth buffer and changing the depth information of the pixels rather than just affecting the render texture of the output screen as it should be. As the fog scattering is calculated based on the depth buffer information, it will be applied to the scene in the wrong place if the depth buffer is affected by the anti-aliasing and returns the inaccurate positions of each pixel.
     
  7. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    45
    This makes a lot of sense. Unfortunately the v1 PP stack was last updated in November of last year:

    upload_2018-7-8_17-28-45.png
    Post-processing stack v2 also has several advantages over to the first stack when it comes to VR development. I wouldn't use the build from their github page, but instead use the package manager to get the latest stable version:

    upload_2018-7-8_17-30-13.png

    Any chance that you can support the new Post Processing stack?
     
  8. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    I noticed that Post Process Layer creates some buffer commands to capture the screen in a render texture before any image effect has been applied to the scene and seems to use that render texture as the basis of the anti-aliasing effect process. Perhaps this is the cause of the lack of fog on the edges of the mountains.

    So I tried to do the same, create a command buffer to capture the raw screen with no effect to use in the fog scattering effect. That worked in parts. The problem at the edges of the mountains was solved, but the image continued to be distorted by the TAA effect causing the fog flickering due to the depth buffer distortion.

    The only solution I found was to force the fog scattering to be rendered after the opaque geometry and before the transparent geometry. In other words, this causes the fog scattering effect to be applied to the scene before the post-processing stack changes the image and affects the depth buffer. This fixed the problem completely.

    To achieve this, you should just open the AzureSkyFogScattering.cs script and uncomment the line with the [ImageEffectOpaque] attribute.

    But keep in mind that the fog will be applied to the scene before the transparent objects are rendered, so even if the transparent objects draw their positions to the depth buffer, they will not be affected by the fog. This is the case of assets like Ultimate Water System that draw correctly to the depth buffer but are rendered in the Transparent shader queue.
     
    Last edited: Jul 11, 2018
  9. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,053
    @DenisLemos, I'm using Azure[Sky] 4.2 and am generally pretty happy with it. However, I'm currently attempting to un-break transparent stuff in our game. We don't have a heck of a lot of it, but we do need what's there.

    My solution at the moment has actually been to stop using Azure's scattering camera effect, and instead enable Unity's own fog. It doesn't look as good, but it plays nice with the rest of the scene which is of higher priority.

    For now I've made a colour gradient by sampling the horizon colour at different times of day, and I'm using that to set the Unity fog colour based on the time of day in Azure. The results aren't bad, but what would be far better is if I could get the current approximate / average horizon colour from Azure somehow and use that instead. Is this a possibility?

    Edit: For clarity, I know that there's the two camera solution available. Alas, using that approach means either running our post processing again for our transparent objects, or having our transparent stuff not effected by post effects.
     
    Last edited: Jul 16, 2018
  10. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    The fog scattering is a post-processing effect and only affects objects that draw to the depth buffer because using the depth information is the only way to find out the position and distance of each pixel on the screen.

    Transparent materials do not draw to the depth buffer, and in fact, they should not even do this for several reasons.

    Transparent objects like glass windows only show what is behind them, so it does not make much sense to be affected by the fog.

    If there are opaque objects in your scene with some transparent parts, you should use a Cutout shader. This is how vegetation shaders work.

    The problem is with semi-transparent materials. Even if you can edit your transparent shaders to make them draw their positions to the depth buffer, this would not work very well because each pixel can store only one position in the depth buffer and when the transparent material draw the position to the depth buffer, it will override the position of the one behind it. So if you are for example, inside a building that has a semi-transparent window that draws to the depth buffer, the fog will only take into account the position of the window and will not affect the distant mountains behind the window.

    The only solution I have in mind for a future update is to edit the transparent shaders to calculate the fog effect inside each material, this way the position of each vertex of the mesh is available and it is not necessary to use the depth buffer. This is how Unity's standard fog works.
     
  11. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,053
    @DenisLemos, yes, I understand all of that, and that's exactly why I've switched back to using Unity's own fog.

    However, I still want to synchronise it's colour with the horizon (or something) from Azure, as I want to use everything else from your system. That's why I'm asking if there's a way for me to get the current approximate horizon colour? Or any colour I could use to similar effect.

    I'm aware that it's a bit nebulous because there is no single colour, but anything I can use to get approximate visual continuity would be great.

    As a long term thing this would be amazing and, to be honest, is probably the only solution I would consider acceptable for my current use case.

    I much prefer your effect over the Unity one. It allows control and subtlety that the built-in stuff (and other solutions I've looked at) just can't achieve. If I can have that and properly handle transparent stuff I'll be very happy indeed. Until then, proper handling of transparent stuff is more important.
     
  12. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    I do not know any other way. The Unity's default fog is limited and because it allows you to set only one color to the whole scene, I do not see any other alternative besides using a gradient to change the fog color according to the time of day as you are doing until a solution is implemented to the asset.
     
  13. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    45
    Reasonable solution, but not useful if it limits me from using transparent materials. Is pp v2 something you will be supporting down the lifecycle?
     
    angrypenguin likes this.
  14. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,053
    So there's nothing I can do with Azure to use it to approximate what that one colour should be?

    To be clear, I made my gradient by picking a spot on the horizon, changing the time of day, setting the percentage on the gradient to match the percentage through the day, then setting the colour there by colour-picking from the horizon. The colours I picked come from Azure, they're just currently coming via a very manual, error prone and time consuming method (ie: if we change sky settings we'll need to do that again). I'm not after perfect visuals, I'm after a better workflow.

    Edit: I wonder if I could make a skybox-agnostic system that reads some pixels from the skybox, averages them out and then sets it as the fog colour?

    Indeed. I've got stuff like jet trails that either look wrong up close or look wrong in the distance in a game where flying around is half of what you do. Or even in cases like looking through a window, the choices right now are have the window fogged out based on the distance of things behind it, or have things behind the window not receive fog, or use Unity's fog.
     
    Last edited: Jul 19, 2018
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,586
    I'm trying to solve an issue with VegetationStudio which does some advanced shadow casting based on the directional light. In AzureSky there are 2 directional lights so I want to programmatically switching which directional light VegetationStudio is using based on which one is enabled in AzureSky. I had thought that Simple mode only had one light enabled at any one time, but when I used that approach I was getting a constant flickering of shadows for long periods of time. So I decided to debug it and check when both lights are enabled and output the time of day. What I found is that both lights are enabled from 6am to 5pm. I think this must be a bug because Simple mode has the lights opposite each other and there's no reason why the moon should be active when it has completely gone down. Thoughts?
     
  16. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    This is not a bug, it is working as it should. The two lights are active at the same time to make a smooth transition from day to night.

    If you do not want this behavior, simply set in the Lighting tab the curve that control the intensity of the directional light of the sun and the curve that control the intensity of the directional light of the moon so that the two lights do not become active at the same time.

    For example, set the intensity of the sun light to 0 when it is 6 pm and increase the intensity of the moon light after that time. When is 6 am set the intensity of the moon light to 0 and increase the intensity of the sun light after that time. Thus only one directional light will be active at the same time.

    Note that the sky controller automatically turns the light off when the intensity is 0.
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,586
    Ok, but it still seems odd. The length of time they are both active is pretty extreme and moonlight won't be affecting any objects when it's completely beneath the terrain. But I will do as you suggest and fix the curve. Thanks.
     
  18. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    375
    Do I still need AzureMoonSphere and AzureSkydome layers from old version? Or should I remove them?
     
  19. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    No, this is no longer necessary!

    The moon is no longer created by using a rendering texture generated from a 3D mesh in the scene as in the old version. In the old version, it was necessary to define a unique layer for the moon sphere mesh so that the render texture had only the moon rendered without the other Game Objects of the scene. In recent versions, the moon is generated procedurally using raymarching, this new method is much faster and excludes the need to use a 3D mesh and a render texture.

    If you use the sky set as skydome and want some reflection probe to render only the color of the sky then you need to add the skydome mesh to some special layer and configure the probe's Culling Mask to render only the layer containing the skydome just as you would do with any other Game Object.
     
    Crossway likes this.
  20. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    375
    Thank you. Also It could be awesome if there was a PlayMaker action along with azure to change between weather profiles.
     
  21. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Azure[Sky] Lite v 1.1.0
    New.png


    v1.1.0 (Unity 2017.4.8f1 LTS) The old version will still be available on Unity 5.6
    • The system was redone completely from scratch:
    • New sky model.
    • New static cloud shader with rotation speed.
    • New fog scattering.
    • Now only one directional light is used instead of two.

    Many improvements and corrections have been made, you can compare the images from the previous version with the new version.
    Screen1.png Screen2.png Screen3.png Screen4.png

    The new version is not compatible with the previous version, so do not try to import the asset into a project that already has the old version. Always save a copy of your project before making any updates.

    The new version has already been sent to the Asset Store and should be available very soon.
     
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,586
    I like this change. Will this be changed also in the non-Lite version?
     
  23. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Yes, all the improvements I'm implementing in the Lite version will also be implemented in the full version. Some of these features are already implemented in the full version, others will be soon.

    I use the Lite version as a test base for new features as it is easier to work with. I'm currently working on a feature to make the fog work with transparent objects, and I've just made the fog compatible with the transparent objects that use the standard shader.
    TransparentObjects.jpg

    The package will come with an alternate version of all Unity transparent shaders edited to work with the fog scattering effect and also with instructions to make any other custom transparent shader work with the fog scattering.
     
  24. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    375
    Is there a way to change weather profiles through Playmaker? That can be useful to change between profiles during gameplay.
     
  25. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    The sky controller method that changes the weather is public and can be accessed from anywhere. You just need to call the method: public void SetNewWeatherProfile (int target) and pass as parameter the profile number from the "Weather Profiles" list that you want to change.

    The developer of PlayMaker has already replied about this in a previous post and said that it is possible to access other methods and scripts. See post #565 and #566.
     
    Crossway likes this.
  26. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    375
    Yeah that works. Thank you a lot :)
     
  27. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    89
    Great asset btw. Thank you for sticking with it and adding so much since its first release. So hoping you can point me in the right direction on an issue that is not directly related to your tool. I am using a water system that takes in a cube map ie skybox image into its shader. I want to override that hardcoded skybox image with an azuresky generated one so that the ocean takes on some of the environment (sky) more accurately. I am just not sure the best way to generate that cube map? Any thoughts. I have tried using reflection probe which sort of works but does not seem completely correct, ocean ends up looking very uniformed and washed out. Again I totally understand this has nothing to do with your product, which is top notch, so appreciate any thoughts. Thanks.

    Just for reference here is the cube map that the ocean is using that looks great.
     

    Attached Files:

  28. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Hi!
    If you just want a Azure[Sky] cubemap texture, you can use the Camera.RenderToCubemap method to render the scene into a static cubemap and use later in your water shader. See the wizard example in the documentation page that does just that.
    This is a cubemap of the sky that I created using the wizard example from the documentation page.
    SkyCubemap.jpg

    The process to achieve this is very simple:
    1. Create the wizard example C#script from the documentation page.
      Code (CSharp):
      1. using UnityEngine;
      2. using UnityEditor;
      3. using System.Collections;
      4.  
      5. public class RenderCubemapWizard : ScriptableWizard
      6. {
      7.     public Transform renderFromPosition;
      8.     public Cubemap cubemap;
      9.  
      10.     void OnWizardUpdate()
      11.     {
      12.         string helpString = "Select transform to render from and cubemap to render into";
      13.         bool isValid = (renderFromPosition != null) && (cubemap != null);
      14.     }
      15.  
      16.     void OnWizardCreate()
      17.     {
      18.         // create temporary camera for rendering
      19.         GameObject go = new GameObject("CubemapCamera");
      20.         go.AddComponent<Camera>();
      21.         // place it on the object
      22.         go.transform.position = renderFromPosition.position;
      23.         go.transform.rotation = Quaternion.identity;
      24.         // render into cubemap
      25.         go.GetComponent<Camera>().RenderToCubemap(cubemap);
      26.  
      27.         // destroy temporary camera
      28.         DestroyImmediate(go);
      29.     }
      30.  
      31.     [MenuItem("GameObject/Render into Cubemap")]
      32.     static void RenderCubemap()
      33.     {
      34.         ScriptableWizard.DisplayWizard<RenderCubemapWizard>(
      35.             "Render cubemap", "Render!");
      36.     }
      37. }
    2. Create a new scene and delete the standard directional light.
    3. Drag the Azure[Sky] prefab to the scene.
    4. Create an empty cubemap by menu: Create>Legacy>Cubemap.
      • Set the face size to 1024 or whatever value you prefer.
      • Check the Readable option.
    5. Generate the cubemap by menu: GameObject>Render into Cubemap.
      • Drag the camera or sky controller to the Render From Position field.
      • Drag the cubemap that was previously created into the Cubemap field.
      • Press the "Read!" button.
      • Now your new cubemap should be ready to be used in your water shader.
    6. You can create several different cubemaps and switch between them using the Material.SetTexture method.
    If you want to update the water reflections in real time, it is necessary that you have an intermediate knowledge about shaders. The best way is to modify the water shader to use the information contained in the reflection probes instead of using a static cubemap.
    Some links that may help.
    https://forum.unity.com/threads/accessing-reflection-probe-cubemaps.307077/
    https://forum.unity.com/threads/reflection-probes-in-custom-shader.322562/
     
  29. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Azure[Sky] Lite v1.2.0
    TransparentFog.jpg

    v1.2.0 (Unity 2017.4.8f1 LTS)
    • Added fog scattering compatibility with transparent objects. (Experimental)
    • The package includes some transparent shaders already modified to work with the fog scattering. These shaders do not replace the original Unity shaders, both versions are available. The copies of modified shaders can be defined in materials inspector by the following address: Azure[Sky]/BuiltIn/...
    • Custom transparent shaders will need to be modified, the package includes instructions on how to make your custom transparent shader compatible with the fog scattering effect.

    Next step is to implement these new features also in the full version of the package.
     
    angrypenguin, ftejada and magique like this.
  30. ledbetterman

    ledbetterman

    Joined:
    May 5, 2015
    Posts:
    72
    Really enjoying Azure[Sky]; it's a beautiful asset! I'm using the old Pre-computed version in my current project, as I need the altitude variation. I notice that this version does not play well with new post-processing stack included in 2018.x.

    Currently the fog scattering effect supersedes the post-processing stack. Any suggestions on how to get them to play well together?
     
  31. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    They have changed something in the new version of the post processing stack that has broken the operation with other image effects that use the depth buffer.

    The only solution at the moment is to open the "AzureSkyFogScattering.cs" script and uncomment the line with the [ImageEffectOpaque] attribute. This will cause the fog to be rendered in the scene after the opaque geometries and before the transparent geometries, so the fog effect will be applied before the post processing stack changes the depth buffer. This solved the problems I encountered with the new version of the post processing stack.
     
    ledbetterman likes this.
  32. DavidLieder

    DavidLieder

    Joined:
    Feb 14, 2016
    Posts:
    83
    Post-processing v1 has been deprecated and completely removed from the Asset store. V2 is available only from the Package Manager.
     
    DenisLemos likes this.
  33. Akshara

    Akshara

    Joined:
    Apr 9, 2014
    Posts:
    91
    DenisLemos likes this.
  34. DavidLieder

    DavidLieder

    Joined:
    Feb 14, 2016
    Posts:
    83
    They put it back then. The Cinemachine staff had gotten Unity to take it off but I guess devs complained. It *will* be taken off at some point because it's being deprecated.
     
  35. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    532
    I do not understand!!!
    Are you going to remove the Post Processing Stack ??? Because of CineMachineá fault ???

    Sorry for the stupid question, but what is happening? Can someone explain something to me?

    regards
     
  36. DavidLieder

    DavidLieder

    Joined:
    Feb 14, 2016
    Posts:
    83
    Don't worry, you're not losing post-processing.

    Unity as a company wants people to move to version 2 post-processing, which is improved and works with all the new tech.

    Version 1 is no longer being patched to work with the latest developments, including current and future Unity engine versions. If it works now, that's great but it's not because anyone at Unity is working on it.

    To get version 2, use the Package Manager. The Package Manager is used to deliver many assets in the new Unity, because they can work on it separately from the game engine.



     
    angrypenguin and ftejada like this.
  37. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Azure[Sky] Dynamic Skybox v4.3.0
    TransparentFogSupport.jpg

    v4.3.0 (Unity 2017.4.8f1 LTS)
    • Added fog scattering compatibility with transparent objects. (Experimental)
      TransparentFogSupport2.jpg
    • The package includes some transparent shaders already modified to work with the fog scattering. These shaders do not replace the original Unity shaders, both versions are available. The copies of modified shaders can be defined in materials inspector by the following address: Azure[Sky]/BuiltIn/...
    • Custom transparent shaders will need to be modified, the package includes instructions on how to make your custom transparent shader compatible with the fog scattering effect.
    • Now only one directional light is used instead of two. For this reason, the variables related to the moon have been removed and the variables related to the sun have changed their name, so it is always recommended to make a backup of the project before importing the new version or to import into an empty project to test the modifications before using.
    • This new approach to implementing transparent object compatibility must also have solved the problems with the Post Processing Stack v2.
    The update has already been sent to the Asset Store, is under evaluation and should be available soon. The price has changed from $29.99 to $35, but still have time to buy with the old value.
    Asset Store Link
     
  38. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    532
    Thanks for the help.

    Regards
     
  39. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    199
  40. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Hi!

    As written in the post you mentioned, static clouds have not yet been implemented in the new Standard Sky System, only in the Azure[Sky] Lite version. But it will be implemented very soon, maybe next week.

    In the 1.1.0 update(see this post) of the Lite version, a new 2D static cloud shader was implemented. Only the look of the new shader has been modified, the shader remains compatible with the existing textures and if you create the textures following the process explained in this post, then I believe you can use your custom textures.

    Since this feature is already implemented in the Lite version, it is much faster to implement in the full version.

    I just want to do an experiment before that to test if it will be good to add a different texture to each day profile, so it may be possible to smoothly switch from one static texture to another along with the weather transition.
     
    ftejada and MaximilianPs like this.
  41. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,403
    I'm trying to blend a water horizon and not having much luck. This is what I'm going for.
    upload_2018-8-26_23-11-1.png

    But with azure I always end up with something close to this. Water meets sky with a very hard line and the banding you can see there also.
    upload_2018-8-26_23-14-30.png
     
    Quique-Martinez and MaximilianPs like this.
  42. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    199
    Me too, and also I would need to load my own day/night skymap (if it possible) :rolleyes:
     
  43. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,403
    I can get rid of the banding if I move the fog distance out further, basically move the band to where water/sky meet. But that's not very useful really if you want closer in fog.
     
  44. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    This is strange, what water plugin are you using? Does this water plugin draw correctly to the depth buffer?

    I've done some tests with Ultimate Water System and everything seems to be running smoothly.
    WaterFog1.jpg




    [Off Topic]
    Making Azure Compatible with Ultimate Water System: UWS draws correctly to the depth buffer and already worked seamlessly with the Azure fog. But recently a feature has been added to make the fog compatible with transparent objects and by default the "AzureSkyFogScattering.cs" script comes with the [ImageEffectOpaque] attribute. This causes the fog scattering to be rendered after the opaque geometries and before the transparent geometries and consequently, the fog no longer affects the UWS because the water shader is sorted in the transparent rendering queue.

    Possible solutions:
    • Hard: Calculate the fog projection directly on the water shader as explained in the "Read Me" file with instructions on how to add fog to custom shaders.
    • Easy: Just comment the line code with the [ImageEffectOpaque] attribute in the AzureSkyFogScattering.cs script. This solution is simpler, but it will generate a new problem. Since the [ImageEffectOpaque] attribute has now been removed from the fog scattering script, the fog will render over the objects with transparent materials and cause conflict as seen in the image below with the barrel set with a transparent test material.
      WaterFog2.jpg
      The solution to this problem is also quite simple, but it will require a little more performance.
      • Simply define in the material of your transparent GameObject the edited version of the transparent shader that comes with Azure, for example "Azure[Sky]/BuiltIn/Standard".
      • Finally, simply add the barrel to the TransparentFX layer or create a unique layer for the GameObjects that should be excluded from post-processing fog rendering and in the camera inspector containing the fog script, set the layer with the transparent GameObjects to "Exclude Layers". This way the fog post-processing will ignore the GameObjects of this layer and the fog will be applied to these objects directly by their materials.
        WaterFog3.jpg
    • [Edited] I noticed that if you change the order of the scripts in the Camera Inspector and put the fog effect script after the UWS scripts you do not have to do the steps of the previous solutions because everything will work without having to change anything. But these modifications will still allow the fog to work perfectly with the underwater effect and also with the water Render Mode set as Default Queue.
     
    Last edited: Aug 28, 2018
    ftejada likes this.
  45. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,403
    I'm using UWS with the regular azure 4.3.0. Noticed you were using the lite version there, would that matter?
     
  46. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,403
    I removed azure completely and reinstalled and that seems to have fixed things.
     
    DenisLemos likes this.
  47. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Not really because the codes of both versions are the same, only the features available in each version change.
    This is a screenshot using the full version v4.3.0.
    WaterFog.jpg


    I'm glad you solved the problem.
     
  48. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    501
    Azure[Sky] Dynamic Skybox v4.3.1
    Sunset.jpg
    Noon.jpg Night.jpg
    v4.3.1 (Unity 2017.4.8f1 LTS)
    • Added Static Cloud shader with texture transition between each day profiles.
    • To switch between cloud types simply change the "Cloud" popup in the Options tab of the sky controller.
    • Each day profile has a field to define a cloud texture and settings different from each other, so it is possible to make transitions from one static cloud to another using the weather system.
    • To create your custom static cloud textures, just follow the process explained in this post(#499).
    • Asset Store Link: https://assetstore.unity.com/packages/tools/particles-effects/azure-sky-dynamic-skybox-36050
    PS: The water in the screenshots is from Ultimate Water System.
     
    ftejada and magique like this.
  49. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,053
    Beautiful!
     
  50. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,403
    Was testing out a new water system and it doesn't play nice with azure. It's blocking all scattering/fog where the water is, almost looks like it's doing the same for some of the sky also hard to tell. Was hoping you might have some idea what it might possibly be from the following pic. Anything that might point me in the right direction as I go through their shaders.

    upload_2018-8-30_21-34-10.png