Search Unity

Graphics Azure[Sky] - Dynamic Skybox

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

  1. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Azure[Sky] Dynamic Skybox
    SocialMedia.png
    Asset Store Link:
    http://u3d.as/fPD

    Azure[Sky] Dynamic Skybox is a complete and robust sky system that will raise your project to another level. This system is being improved since 2015 always considering the feedback and needs of the users and for this reason, the plugin has become the tool with the best cost-benefit of its category. Do not be fooled by the low price, the plugin is an indie tool and offers a lot more than it costs.

    Performance:
    The performance was a factor taken very seriously in the development of the asset and each feature was carefully planned to get the best performance possible. This is not a tool for mobile devices, but due to its complexity and purpose, you will not find another tool that offers all the features with the best performance.

    Sky System:
    The sky system is physically based and offers a complete and realistic day-night cycle, feel free to change all settings of the sky as you want and even reproduce the atmosphere of other planets like Mars. The sky works as a skybox material, but if you prefer you can simply switch the sky mode to a skydome mesh. The system also gives you complete control over the scene lighting at any time of day.

    Fog System:
    The fog scattering effect is one of the most amazing features of the asset, the effect adds a lot of realism to the scene and smoothly blends the horizon with the sky. The plugin supports distance and height fog, and the package includes instructions on how to edit your custom transparent shaders to work properly with fog as well as an alternate version of some of the most commonly used transparent shaders already modified to work with fog effect.
    Fog1.jpg Fog2.jpg

    Time and Date System:
    Azure[Sky] provides a complete time system with a lot of options. Supports the accurate position of the sun and moon based on the time, date and geographic location with latitude and longitude, the moon phases are accurate with automatic adjustment according to position and time. You can change the length of the day to make the daytime last longer than the night or vice-versa, the sky controller also provides a complete calendar directly in the Inspector for easier navigation and selection of dates.

    Profile System:
    The profile system of Azure[Sky] is the most complete profile system you will find, you can create as many day profiles as you want and modify "all" the properties to get different days settings. You can easily change the sky settings by switching from one profile to another manually by the Inspector or automatically using the weather system, the sky controller also allows you to set a different day profile for each calendar day in a one-year cycle. You can use the same day profile in different scenes or share with other users and team members.

    Weather System:
    Changing the weather conditions at runtime is very simple, you can create a list of day profiles with a variety of different weather settings and smoothly switch between each day profile in the list. The weather system also provides a lightning effect and a complete sound fx to simulate rain, wind, and thunderstorms.


    Cloud System:
    Azure[Sky] provides 2 types of cloud shader (Dynamic and Static), both with excellent performance and fully integrated with the weather/profile system. You can also disable the clouds to only use the background sky if you want to use some third-party cloud shader.

    Curve and Gradient System:
    Azure[Sky] was the first sky system to introduce the intensive use of curves and gradients to extend the asset's customization power. With this feature, you can set different values to the properties at any time of the day providing total control over all the properties of the sky system. For example, you can set the fog curve to increase the amount of fog at the night/morning and reduce in the afternoon. With the Curve and Gradient System, it is also possible to achieve different weather conditions along the cycle of the day using the same profile.

    Output System:
    The Output System is another innovation introduced by Azure[Sky]. Do you need extra properties to control the stuff of your game that needs to be updated according to the time of day? No problem, the Output System allows you to create as many curves and gradients as you need to control all sorts of things, such as increasing the sound effects of forest animals at night or turning the city lights on/off according to the time of day.

    Standalone Demos:
    Weather || GI

    - Supports Linear and Gamma Color Spaces.
    - Supports All Rendering Paths.
    - All C# Source Code.

    Add fog scattering support with:

    • These instructions were created using the "Legacy Render Pipeline".
    • Some of the assets mentioned below do not support Universal Render Pipeline for better testing.
    • The Crest instructions were made using the free version available on GitHub. Unfortunately I don't have the Asset Store version with URP support to see if anything else needs to be done.
    • Note: If you change Azure package directory, you need to update the #include path explained in the instructions below to use the new location of the AzureFogCore.cginc.
    1. Open KWS_WaterTesseleted.shader and uncomment his line.
      #define AZURE_FOG

    2. Save the shader, by default all the modifications you need to do was already made by the KWS Water System developer.

    3. Open KWS_FoamParticles_standard.shader add this line of code along with the other #include files. This will import the fog data to be used in the shader.
      #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"

    4. Also to the same shader, add this code one line before the return of the fragment function (half4 frag_foam(v2f_foam i) : SV_Target).
      result.rgb = ApplyAzureFog(result, i.worldPos.xyz);

      This will make the fog also affect the shoreline that aparentelly not get Azure fog by default.
    1. Open Crest Ocean.shader and add this line of code along with the other #include files. This will import the fog data to be used in the shader.
      #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"

    2. The Crest shader by default already have the world position coordinates, so it is not necessary to add new calculations since we can use the coordinates that are already in the shader.

    3. Replace in the fragment shader the Unity built-in fog implementation:
      UNITY_APPLY_FOG(input.fogCoord, col);
      by the Azure fog implementation:
      Use this for the GitHub version of Crest:
      col = ApplyAzureFog(half4(col, 1.), input.worldPos);

      Use this for the Asset Store version of Crest (URP version):
      col = ApplyAzureFog(half4(col, 1.), input.positionWS_fogFactor.xyz);


      The code snippet should look like this:
      // Fog
      if (!underwater)
      {
      // Above water - do atmospheric fog. If you are using a third party sky package such as Azure, replace this with their stuff!
      //UNITY_APPLY_FOG(input.fogCoord, col);
      col = ApplyAzureFog(half4(col, 1.), input.worldPos);
      }
      else
      {
      // underwater - do depth fog
      col = lerp(col, scatterCol, 1. - exp(-_DepthFogDensity.xyz * pixelZ));
      }


    4. Remove any other directional light source from the scene, the Azure prefab already have a directional light.

    5. Add the Azure directional light to the "Primary Light" on the "Ocean Render" component

    6. Add the Azure directional light to the "Sun Source" on the Unity's Lighting window.

    7. Add the Azure fog scattering effect to the camera and set a proper fog distance for each day profile in use by the sky manager.

    8. You may need to use a reflection probe to reflect the sky changes in the water surface, the best option is to use the reflection probe from the Azure prefab because it have some extras options that is not avaliable in a regular reflection proble by default.

    9. Set the reflection probe box size to a far distance, so the ocean reflections will cover the entire wather surface.
    1. Azure[Sky] Dynamic skybox v4.3.9 comes fully integrated with Lux Water and you do not need to change anything in Azure.

    2. In LuxWater you need to edit the shader file "LuxWater_Setup.cginc" and uncomment the #define and #include corresponding to Azure fog and make sure to comment all other #defines.

    3. Then right-click to reimport the “LuxWaterCG” and “LuxWater CG Tessellation” shaders.

      //For the underwater effect to work properly
    4. Set in the camera the fog scattering script before the LuxWater_UnderWaterRendering script.

    5. Set the Directional Light from the sky controller to the "Sun" property of the LuxWater_UnderWaterRendering script.
    1. Open the 2SidedTripleTextured shader or the shader version of the water that you want to use.

    2. Add this line of code along with the other #include files. This will import the fog data to be used in the shader.
      #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"

    3. Aquas shaders by default already have the world position coordinates, so it is not necessary to add new calculations since we can use the coordinates that are already in the shader.

    4. Finally, just add this line of code to the fragment shader above the return definition.
      finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz);
      The code snippet of the final color will look like this:
      /// Final Color:
      float3 finalColor = diffuse + specular;
      fixed4 finalRGBA = fixed4(lerp(sceneColor.rgb, finalColor,lerp( _multiplier1, 0.2, _UnderwaterMode )),1);
      UNITY_APPLY_FOG(i.fogCoord, finalRGBA); // Uncomment it if you do not want Unity fog
      finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz);
      return finalRGBA;


    5. Do the same previous steps for the "FORWARDADD" pass, but this time in the fragment shader use this code to avoid problems with spot and point lights:
      finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz, float4(0,0,0,0));
      instead of:
      finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz);

    6. Save the shader and enjoy.
    1. Open the "Simple Water Sample" shader from Gaia package.

    2. Add this line of code along with the other #include files. This will import the fog data to be used in the shader.
      #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"

    3. Change this line:
      #pragma surface surf StandardSpecular alpha:fade keepalpha
      to this:
      #pragma surface surf StandardSpecular finalcolor:ApplyFog vertex:vert alpha:fade keepalpha

    4. And finally add this void above the void surf(surface program). This applies the fog scattering color over the output color of the surface shader.
      void ApplyFog(Input IN, SurfaceOutputStandardSpecular o, inout fixed4 color)
      {
      color = ApplyAzureFog(color, IN.worldPos);
      }


    5. Save the shader and enjoy.
    The developer of Hydroform has commented that his asset draws to the depth buffer, but for some reason, the water is not detected by the Azure fog effect. So the solution is to follow the instructions to implement the fog scattering with transparent materials.
    1. Open the WaterFunc.cginc and add this line at the top.
      #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"

    2. Change the "return" of the calcPixel function of the WaterFunc.cginc from this:
      return saturate( waterColor );
      to this:
      return ApplyAzureFog(saturate( waterColor ), inData.worldPos);

    3. To avoid duplicate fog generated by the GrabPass, open the Water.shader and change the Tag setting from this:
      Tags { "Queue" = "AlphaTest" "RenderType" = "Opaque" "ForceNoShadowCasting" = "true" }
      to this:
      Tags {"Queue"="Transparent-2" "RenderType"="Transparent" "ForceNoShadowCasting" = "True"}

    4. Also open the Brim.shader and change the Tag setting from this:
      Tags { "Queue" = "AlphaTest+1" "RenderType" = "Opaque" "ForceNoShadowCasting" = "true" }
      to this:
      Tags {"Queue"="Transparent-1" "RenderType"="Transparent" "ForceNoShadowCasting" = "True"}

    5. Set the sky controller directional light to the "Specular Light" field in the "Surface FX" section of the ocean prefab.
    Hydroform does not reflect the sky in real time, so you can take a look at post #628 of Hydroform forum to find a step by step how to achieve this behavior.
     
    Last edited: Jul 3, 2022
  2. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Amazing, I can't figure out how to get the sunset colour correctly from Preetham. You did a good job on that. nice cloud and scattering fog too.
    [Edit]
    I just saw you use the orange colour in the setting for sunset , cool. Btw, welcome to Unity Community.
     
    Last edited: May 1, 2015
  3. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Thanks!

    The sunset color is defined by the user in the inspector. It is white when the sun is high in the sky and changes to the chosen color in the inspector when the sun descends on the horizon.



    Denis Lemos
     
    Last edited: May 4, 2015
  4. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    cool one
     
  5. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    The first version is now available in the Asset Store.
    http://u3d.as/fPD

    For the next updates will be reformulating the equations and rewriting the code to C #.
    I am also creating a new cloud system and improving the night sky.
     
  6. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    The current version of azure[Sky] is very far from what I want. But I'm doing some tests and the visual aspect is improving a lot.
    Because of that, I'm recreating everything from scratch.
    The clouds are what most needs to be improved, so I am now dedicating my time on them.

    That's what I got so far:

    * A cloud texture that simulates the direction of light and shade according to the sun's position. See the GIF below.


    * When the clouds are in front of the sun, the dense part is dark and the edge that generally has less density are very bright.
    A photo of what I mean
    https://mindfulbalance.files.wordpress.com/2011/04/sun-through-clouds.jpg

    That's what I got so far:

    Sun in 90º


    Sun in 90º - Horizon


    Sun in (10º-15º) - Horizon


    That's only test, then it will take a while to be available. As I am recreating everything from scratch does not have night sky. At the moment I am focusing in the clouds and in the daytime sky.
     
    SAOTA likes this.
  7. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    I might purchase this asset, but I have one question before. If you shift rapidly between day and night you can see that it takes some time before the reflection probes update on the spheres and all faces are not updating at the same time so it creates ugly seams on the reflection map. What were your settings for the probe? it there a way to avoid this?

    Thanks!
     
  8. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    I think this is because the reflection probe was defined as individual faces in Time Slicing, switched to "no time slicing" and seems to have solved the problem, the demo has been updated !
    I still do not know very well set the GI
     
  9. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Ok it looks much better now! I will push so we buy this now thanks!
     
  10. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Hi! Firstly thanks so much for this asset - I recently purchased it and it looks amazing. I really hope you find time to keep enhancing and supporting!

    I have a quick question. I believe that Azure[sky] doesn't explicitly support mobile but I've been trying to get a simple scene running on my iPhone 5s. Using the GI_Demo scene, at mid-day, the skybox is completely black / very dark blue. Digging into the shader a little, if I visually output 'Brm' or 'fex' I get different results on my phone compared to the editor. If I output Layer1 for example, I get exactly what I'd expect (i.e. a Skybox of Layer1) so the shader compiles, the viewDir is correct etc. Have you any idea what this could be down to? I'm fearful it's something like floating point precision between the different devices.

    Many thanks in advance for your help!

    P.S. I've ensured my 'quality' settings etc are the same for my editor and device.
     
  11. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    I'm sorry for being slow to respond, as I had to buy a new PC while developing this asset, I had not installed the SDK for testing with mobile device. And unfortunately I do not have an iPhone just an android device.

    Today I installed the android SDK and did a test on my Galaxy s4 using the demo scene only with the skybox without using GUI and GI objects. And it worked normally, but for being an SM 3.0 shader and not be too optimized worked with some lag. So at this point I still do not recommend for mobile games.
    I was thinking of making an attempt to polish this version putting arbitrary values in the equations and find the resulting value to use it in the shader without the need of repeating the calculation. Thus will not have much customization option, but will have a gain in performance. And putting some calculations in the vertex program, it may be possible to leave the shader for SM 2.0

    As in my android device worked without any visual difference to the editor, I believe it's something in the IOS platform.

    Try changing in the shader the declaration of variable "sunCosTheta" and "moonCosTheta" of half to float. Ex:
    Code (CSharp):
    1. half sunCosTheta = dot( viewDir, sunDir );
    2. half moonCosTheta = dot( viewDir, moonDir);
    to
    Code (CSharp):
    1. float sunCosTheta = dot( viewDir, sunDir );
    2. float moonCosTheta = dot( viewDir, moonDir);
    or
    Code (CSharp):
    1. float sCos = dot( viewDir, sunDir );
    2. float mCos = dot( viewDir, moonDir);
    3.  
    4. half sunCosTheta = sCos;
    5. half moonCosTheta = mCos;
    I think "viewDir", "sunDir", "sunCosTheta" and "moonCosTheta" are the most important values of the formula and may require very accurate numbers, but I'm not sure and it costs nothing to try.

    If you send me a PM or here on the topic some image of the error and the configuration that you are using in the sky, maybe I can identify the problem, if it is in customizing the material.
     
    Timboc likes this.
  12. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Thanks for your response and looking into this. I was going to reply yesterday but I wanted to wait until I made a bit of concrete progress before replying. Through experimentation I found that a combination of things are required to get it displaying correctly on iOS.

    I appreciate some of the following sounds a little odd (and it is) but it's all hard won knowledge.
    1) The strangest - I need to explicitly define 'Br' and 'Bm' within the frag shader
    2)
    Higher precision is needed on the iphone so I've currently made viewDir, sunCosTheta, moonCosTheta, BrBm, fex and SLin all floats.
    3) I believe many of the function calls to the include files functions are returning inaccurate results (or at least not with high enough accuracy). Therefore, inlining the calculation for 'fex', BrTheta & BmTheta was necessary (but also allowed for some optimisation).
    4) I've also gone from 20-24fps to a smooth 30fps by making various optimisations. By moving the normalisation of viewDir into the vertex shader (and ignoring the horizon shift) I can then also evaluate SunCosTheta, MoonCosTheta, Zenith, Esun, Emoon, SR & SM, Day & Night Luminance, StarFade, SunsetColor & MoonsetColor in the vertex shader. I think I just about get away with it.

    Obviously 1) is the most strange and means hard-coding the ray & mie. Also, it's not totally perfect - see screenshots. Getting a strange green tint at sunrise. Also notice the sky seam is quite visible. Lastly the reflection probe isn't working but it was at one point so I'm pretty sure that's not related.

    IMG_3871.jpg

    I hope this info's useful to someone - let me know if you want a copy of the shader I'm currently using.
    Update: I think the colour tint is a simple copy/paste error on my part for the Bm value.
     
    Last edited: Jul 10, 2015
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Is half not high enough precision? float in vertex is preferred on mobile, but in frag I'd imagine half to be as high as I'd go.
     
  14. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Not from my testing (I just tried switching SLin back to half3 and it's totally off) but at any rate, the above is just guidelines of what I think I've worked out so far - please nobody take it as gospel :). Also, 30fps just for the skybox isn't much to get excited about either.
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah although lets be honest, mobile is far from ready for intensive calcs in frag :D
     
  16. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Yes, it would be of great help.

    This is where the two sides of the panoramic textures align. Check that genarate Mip Maps is disabled on any of the panoramic textures in the Import Settings. Also try changing the Filter Mode.
    In the new version that I'm developing, these textures will not be necessary. The new shader will use two passes, one for the sky and one for the clouds, this mode is possible to have more realistic clouds. And the quality of the sky will also increase greatly.

    For sure! The problem is that this type of shader most calculations needs to be done in frag to achieve a satisfactory result because the default skybox sphere is not perfect. Otherwise appears the seam of the mesh in the sky.

     
  17. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Hi,
    How do you manually control the day time? I want it to be always day time but be able to switch to night time on demand while playing. Right now if I move the current time slider while playing it's not doing anything.

    Thanks!
     
  18. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    The slider works only in the editor to choose the start time of the day, I had not thought of that possibility. I will upload an update with this feature.
    If you do not want to wait for the update, it is something very simple to be implemented by yourself.

    Just add it to the script azureSkyControl.js
    Code (JavaScript):
    1. function setTime(time:float,dayDuration:float)
    2. {
    3.     v3.x = -((time) + UTC) * (60*DEGREES_PER_MINUTE)-90;
    4.     if (dayDuration>0.0)
    5.     {
    6.        ROTATION = (DEGREES_PER_MINUTE * 1440) / (dayDuration * 60); //Gets the degree to rotate the sun according to the time selected
    7.     }
    8.     else { ROTATION=0; }
    9. }
    If you prefer you can change the Awake() to this:
    Code (JavaScript):
    1. function Awake()
    2. {
    3.    SkyUpdate();
    4.  
    5.    SKYMAT.SetVector("sunDir",-SUN.transform.forward);
    6.    SKYMAT.SetVector("moonDir",-MOON.transform.forward);
    7.    FOGMAT.SetVector("sunDir",-SUN.transform.forward);
    8.    FOGMAT.SetVector("moonDir",-MOON.transform.forward);
    9.  
    10.    setTime(CURRENT_TIME,DAY_CYCLE_IN_MINUTES); // Set the start time of the day
    11.  
    12.    v3.y+=Longitude;
    13.    MOON.transform.localScale.x*=-1;
    14.    MOON.transform.localScale.y*=-1;
    15. }
    So you will be able to control the time of day and how long it will last, according to events that occur in your game. Just call the setTime() when necessary.
    For example, if you want the scene start at midday and always stay at this time. In the Start() or Awake() call the function this way:
    Code (JavaScript):
    1. function Start()
    2. {
    3.       setTime(12.0 , 0 );
    4. }
    * The first function argument is the time that will be the day, use values between 0-24.
    * The second function argument is time in minutes that the day will take to pass. If the value is zero, the hours will not pass.

    If you want that at some point of the game, the time of day changes to the dusk. In the event that this occurs call the setTime() like this:
    Code (JavaScript):
    1. if (Input.GetKeyDown("space"))
    2. {
    3.    target.setTime(17.5 , 10.0);
    4. }
    In this case the event was press the "space" key on keyboard. This will change the day to 5:30 PM, with the sun setting slowly on the horizon.

    Surely you will need to change the time of day from other scripts, for this you will need to create a variable of type azureSkyControl and drag in the Inspector the GameObject that has the azureSkyControl.js, so you can access, change and use all the variables and functions who are there.
    Exemple:
    Code (JavaScript):
    1. #pragma strict
    2. var target:azureSkyControl;   // Drag in ispector the GamObject that has the azureSkyControl script to this property
    3. var TimeOfDay:float=6.0;      // 6:00 AM
    4. var dayDuration : float =3.0; // New duration of day in minutes
    5.  
    6. function Update ()
    7. {
    8.    if (Input.GetKeyDown("space"))
    9.    {
    10.       target.setTime(TimeOfDay,dayDuration); // Using the function that is in the control script to set the time of day.
    11.    }
    12. }
    In my tests it works very well.

    Thanks !
     
  19. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Great thanks! I also added a checkbox in your editor so you can toggle the transition on/off
     
  20. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Two questions: How's performance? Does it work with Horizon[On]?
     
  21. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    I do not own this asset yet, but from what I read in the author's topic, the version 1.0 of Horizon[On] does not draw to the depth buffer, but the author sends the new shader by PM for those who need them before the release of the next version. The azure[Sky] fog is an image effect and only affects objects that draw to the depth buffer, if you already have these new shaders, i believe that azure[Sky] will work well with Horizon [On].

    My intention is to make azure[Sky] work directly in the skybox. This way is much simpler and intuitive to add to the project, with only a script to manage the entire sky, even a begginer will be able to configure it.

    So far so good, the problem is that the mesh of the skybox is a sphere of low quality and makes it impossible to write the calculations in the vertex program without having unpleasant results. For this reason, most of the equations are written in the fragment shader that calculates once for each pixel on the screen. Causing delays in the shader. But that is only evident in mobile devices.

    The current version 1.0.2 is not optimized as it should be, my first intention was to work, for then optimize. I believe that will not perform well on mobile platforms. In tests I did on Windows PC, the performance was very good.

    I used the FPSDisplay.cs script to count the fps. Found in Wiki:
    http://wiki.unity3d.com/index.php?title=FramesPerSecond
    In GI demo scene the fps was around 1100.
    In the fog demo scene the fps was around 720. The terrain was the most responsible for the drop in frame rate.



    The next version will jump to 2.0.0 because it will have many changes compared to the current version, the two versions will have a very different appearance from each other. For this reason the current version will continue in the package and will have all the improvements of the new version, but it will keep the visual characteristics it has now. Because depending on the graph style of each game, one of the versions can match better than the other.

    So far I managed to reduce almost three times the number of math instructions in the fragment shader and get a much more realistic results than the current version.
    * The moon now is drawn directly into the skybox.
    * And now also implemented the rotation of the sky at night.
    * Added support for HDR.

    Below is a simple demonstration of how it's getting. " P.S. It is still in development. "
    https://dl.dropboxusercontent.com/u/29523611/azure[Sky]DevDemo/azure[Sky] Demo1.html

    It remains to add:
    * The scintillation of the stars.
    * The shadows on the moon.
    * The clouds.
    * Redo the fog scattering.
    * Maybe put some shooting stars across the sky.
    * Milky Way ?

    I also intend to make an optional version of the shader to use in a Skydome, making it possible to write the calculations in the vertex shader to work in ps_2.0. To have more performance and be able to use quietly in mobile devices.
     
    Last edited: Jul 24, 2015
    one_one likes this.
  22. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    * Added scintillation in the stars.
    * Added shadow on the moon.
    See the demo test:
    https://dl.dropboxusercontent.com/u/29523611/azure[Sky]DevDemo/azure[Sky] Demo2.html
    PS: The shadow on the moon will be controlled by sliders in the Inspector, where you can define the position, size and opacity, as well as in the first version. I did not add the sliders in the demo because I'm using for testing only.

    Now I'm going to work in the clouds. What I'm planning to the clouds is:

    I will use pre-rendered textures in a grayscale. In the RGB channels, will save the luminance of the clouds, based on the sun's position.
    Channel r: Will contain the cloud luminance with the rising sun.
    Channel g: Will contain the cloud luminance with the sun at noon.
    Channel b: Will contain the cloud luminance at sunset.

    As time goes on, the shadows of clouds change according to the luminance and gives a more realistic effect. An example of what I'm talking about, is shown just above in the post #6.
    Until now I got an excellent result for the clouds in the daytime, and I'm trying to get a harmonious effect in the transition between sunset and nightfall.

    Finally, after about three months of trying, I managed to find a way to make an animation in loop for the clouds. If all goes well, the clouds will be animated.

    See the GIF:

     
    Last edited: Jul 31, 2015
    Timboc and one_one like this.
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Excellent work. How soon can we expect the asset?
     
  24. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    I want to do as quickly as possible, the problem is that lack some things that are very time consuming to make. So I will first launch version 1.5 within a few days.

    Version 1.5 will be just the 1.0 with the improvements that will be part of version 2.0. But trying to keep the graphic look of the first version.

    You can see in the demo below:
    https://dl.dropboxusercontent.com/u/29523611/azure[Sky]DevDemo/azure[Sky] Demo3.html

    * The equations were rewritten.
    * Night sky rotation was added.
    * The moon is drawn directly into the skybox.
    * HDR support added.
    * Only one draw call. All this is done in a single pass.

    Only with changes in the equations, we can see great visual changes. The sunset is one example.

    To release azure[Sky] 1.5 still missing:

    * Redo the fog: It will be easy and fast because the calculations are almost the same as the sky.
    * Redo the Inspector: It's a little time consuming, because I am rewriting everything in C#, have to respect some development requirements and do a lot of testing to make sure everything is working.
    * Animation in the clouds: It will be a variation of the sky shader, will have a sequence of images creating a loop animation, will be a test prototype to version 2.0.

    For version 2.0, left to do the same things, but with much more realistic clouds, which is much more difficult to achieve and time consuming to render. Not to mention that you need to render the cloud once for each color channel.

    So I decided to release 1.5 before because the clouds are much simpler to do.
     
  25. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Testing the fog of version 1.5 which will be released soon. The scenario used in the screenshot is the Island Demo.
    Here is the scene in the default settings. The ambient color is dark because the sun is rising.


    Now the same settings with the fog applied.


    Around noon.


    At Night.
     
    Last edited: Aug 24, 2015
  26. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
  27. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    This asset looks great! Any ETA on the 2.0 update with the enhanced clouds?

    Also, based on the way that you are doing your cloud system, do you think cloud lightning would be possible? (example below)

     
  28. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    In post number 22, I explain what I want to improve in the clouds to version 2.0.
    Currently the best result I got was this:
    The clouds will be more realistic and adorned, but the problem is the rendering time. The 1.5.0 version took 25 hours to render, even that clouds this release are very simple. Now imagine how long it will take to render these new clouds, and will be necessary to render the same frame three times, one for each sun position to catch the luminance.

    How the new clouds will be more realistic, I'm afraid that with only 60 frames the animation does not get smooth, I think it will need 120 frames, that will double the rendering time and the number of images for editing. This will give me a lot of work to do. But I think if everything works as I imagine, will have a cool result.

    The new shader will process the clouds in an additional pass, where I can make use of the texture opacity, improving the visual appearance of the sky, the moon will cross behind the clouds and the clouds will interact with the Sun Shaft image effect.

    If is needed to use 120 frames for the animation, will only increase the space of the package in the hd, the performance will remain the same.

    The good side of using this method to clouds is that the clouds are more realistic, the movement of the clouds are almost real and has a low cost performance than if it were generated in real time.

    The downside, is that it increases the size of the package.


    About lightning, at the moment I still can not think of any way to create this effect. Sorry.

    If my explanation seemed confused, sorry, my English is bad.
     
  29. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    For some reason the exposure slider has no effect in my scene, any ideas?
     
  30. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Make sure HDR is not selected in the Options tab.

    This option does not allow the shader computes the tone mapping internally, giving the developer the option of using different tone mapping, such as the image effect "tonemapping" of Unity, located in Component>Image Effects>Color Adjustements>Tonemapping.

    The exposure slider is used only in the internal tone mapping of the shader. It will only take effect in the scene, if the HDR option is disabled.

    If you work with the HDR option enabled, the correct is to change the exposure directly by the image effect component, which also has this feature. Remembering that when using the tonemapping image effect, for it to work correctly, your camera should also have enabled the HDR option.

    That's the only reason I know that prevents the exposure slider working.
     
  31. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Thank you, I eventually worked out the issue last night. I'm glad I asked as I did not know about the Tonemapping image effect and HDR is worth experimenting with visually. Ok so bare with me here I might be doing something wrong again but I cannot seem to get any stars to appear at night time and no sun spot too. Also at night my terrain still remains very lit, I assume it's ambient lighting or something - admittedly I need to have another play today and will suss that one I thinks.

    Few Feature suggestions:
    Scattering Wavelength Adjustments (good for over worldly planets)
    Fog Density Time Curves (good for having fog change more dynamically over the day etc )
    Fog Color Gradients (can be fun and good for other planets)

    Really liking what I see so far, the fog is awesome. Thanks.
     
  32. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    I've managed to get my get my lighting fixed but noticed something very strange, if I add tonemapping and HDR my reflections and lighting on world objects gets fixed to that point in time the day and night cycle. It took me a long time to figure out this was happening. Is this the correct behaviour, when it gets dark my world objects stay fairly lit and the reflections stay as they started on play? No stars working either, thanks again. It's almost perfect.
     
    Last edited: Sep 27, 2015
  33. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Ok sussed it out, sorry for the running commentary. I needed to setup a reflection probe for reflections to update every frame. Durr ;)

    Just missing stars?
     
    Last edited: Sep 27, 2015
  34. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Sorry for the delay

    This was supposed to be implemented, I'll write these things on paper because I forget.

    It is a good suggestion

    The color of the fog automatically adjusts according to the sky settings.

    Strange, this happens in the demo scene included in the package?

    * Make sure the Textures Tab, the fields "Star Field (Cube Map)" and "Star Noise (Cube Map)" is not empty.
    * In the texture import setting of this textures, the "Mapping" option must be: 6 Frames Layout.

    Try to create a new scene, delete the default light and drag one of prefab included in the package into the scene, press in the "Options tab" the button "Send material to Sky Skybox", to apply the material in the sky skybox.

    If the problem persists, please send your project or scene by MP for me to figure out what's going wrong.
     
  35. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Yes the no stars does happen in the demo's including your examples online when testing on Safari. Is it a Open GL compatibility issue maybe? I'm on OSX. I've never seen any stars, even in your product screenshots. No way I can easily send the project, it's about 20GB but I'm happy to skype and setup a test example.
     
  36. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    * Added to the package a shader with only the sky without clouds. This gives the possibility to use their own cloud customized shaders.
    * Added in the "Scattering" tab some sliders to adjust the wavelength.
    Demo: https://dl.dropboxusercontent.com/u/29523611/azure[Sky]_v1_5/EmptySky.html

    The cloud shader to version 2.0 is almost ready, just need to render the animation of clouds, it takes a long time. Until now a 20 percent already rendered.

    Some images of a same frame of the new cloud system.









     
  37. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Sweet, nice man. I shall look forward to trying this out. I've still no luck with the stars strangely. I occassionally see the odd twinkle on my UI cam so am wondering if it's not working due to a multiple camera setup. Is it dependant on deferred pipeline? Anyway I kind of want to use my own cubemap for the stars as shown below. Can you think of a way to allow this when combined with Azure which I love. Thanks for the updates, can we download yet? ;)

    I need that program you use for clouds, expensive it is.
     
    Last edited: Oct 23, 2015
  38. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Well, the problem of the stars was successfully resolved thanks to the help of @Beloudest, have a lot to thank him.

    It was just a syntax error when used the "dot" function.

    As I have not the opportunity to test the package on operating systems other than Windows, I could not realize my mistake.

    I wore a command like this to make the stars appear and disappear.
    Code (CSharp):
    1. dot(sunDir.y, float3(0, -1, 0));
    Strangely DirectX did not cause error, but in OpenGL is need to write this way.
    Code (CSharp):
    1.  
    2. dot(float3(0, sunDir.y, 0), float3(0, -1, 0));
    3.  
    I will be correcting the problem and update the package and demos as well as possible.
     
  39. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    It's just Apple for you, they like to be awkward at any opportunity! No problem. :)
     
  40. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    azure[Sky] 2.0 - Submitted to the Asset store


    See the first post for more information.



    The price will be adjusted to $45. There's still time to secure the purchase for $40 while is in pending review.
     
  41. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Nice, whats new?
     
  42. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Azure[Sky] v2.0 - Available on the Asset store
    http://u3d.as/fPD



    What's new:
    * New cloud shader with several customization options.
    * New options to customize the fog.
    * Added Milky Way to sky night.
    * Added solar disk.
    * Added a "Empty Sky" shader.
    * Bugs fixed.
    * Some other customization options.
     
  43. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    For the next azure[Sky] updates

    * I intend to add a customization system with curves. This will give the option to customize the sky in different ways for each hour of the day.

    * I want to create a procedural cloud system so you can control the weather and the amount of clouds in the sky. I believe it will not be possible to do with the same realism of the current version that was pre rendered in external programs.

    * I am also looking into the possibility of adding to the package a unfinished water shader that I started doing a long time ago and not yet finished. My intention is to make this water shader work together with the sky.

    See an animated gif of the water shader under development.
     
    Beloudest likes this.
  44. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @_7stars

    How many pre rendered skies is included in package?
     
    Last edited: Nov 21, 2015
  45. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    Hi @Morfeuskiev !

    All the demo scenes in the firts post are included in the package.
    Only the clouds are pre-rendered, the rest of the sky works dynamically.

    If you have used the CryEngine, azure[Sky] is very similar. The clouds are just a texture with transparency to show the sky in the background through them. The difference is that the brightness of the azure[Sky] clouds adapt according to the sun's position and do not need to use a Skydome, the clouds are drawn in an additional pass directly into the skybox.

    You can choose to use a shader static or animated clouds. See the demo scenes in the first post.

    Animated clouds are a sequence of 120 different images. But in the shader is only used two textures to make the transition from one to another. When the transition is complete a script change these textures for the next.

    In my tests had no loss in performance by use of many textures, the shader animated clouds is as fast as the static shader. Only increases the game file size.

    My objective is to get a rendering equal as seen in AAA games.
    "witcher 3 Sky Clouds"
     
    hippocoder likes this.
  46. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @_7stars

    Thanks for answer. So if i good understand - your asset have one preset of sky. I read that you pre-rendered this sky. This is not bad, but i want to have a different sky on many scenes of my game. Can you make 5-10 different pre rendered skies? I purchased your product because it is really beautiful. No matter what the method of implementation, but I would like to have more varieties of the sky. In anticipation of procedural clouds :)

    With Best Regards, Leonid.
     
    S_Darkwell likes this.
  47. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    Like @Morfeuskiev, I find your asset absolutely beautiful, but I am holding off on purchasing it because if everyone who produces a game with your asset has the same sky, it will become recognizable.

    Is the process of rendering these skies something that can be shared, or better yet, automated?
    - S.
     
  48. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    787
    @Morfeuskiev

    Now I understand better your question.
    azure[Sky] has only one cloud animation cycle.

    It's almost impractical for me at the moment to make several animation cycles for the clouds, because I Don't have the time that is needed to do this. The animation of clouds you see in the demos took about 600 hours to be processed. That is around 25 days. It was for this reason that the version 2.0 took so long to be released.

    It would take four months to make 5 cycles. I want to use this time only when I get much more realistic clouds.

    If you analyze AAA games you will see that most of them use static clouds to the sky.
    See a Battlefield 4 gameplay:

    Static clouds I can make several different types for use in other scenes, as they are faster to do.


    This will happen with almost all assets of the asset store. Most of the players do not notice or do not give importance to it.

    [Edited]
    I can make a video tutorial showing how to create their own clouds in Terragen. Static clouds are simple to make. Animated clouds becomes the same manner, except that take much longer to render all the animation cycle.
     
    Last edited: Nov 22, 2015
    S_Darkwell likes this.
  49. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Looking forward to the updates! Purchased today and ESPECIALLY looking forward to the procedural clouds. i TRULY hope you can get them looking volumetric! Cheers and thanks for the great asset.

    Gary
     
    DenisLemos likes this.
  50. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @_7stars:

    Thank you greatly for your response!

    I'll be keeping a close eye on this asset, and yes, a tutorial like that would be fantastic! Thank you.
    - S.