Azure[Sky] - Dynamic Skybox v8.0.4



Azure[Sky] Dynamic Skybox is a complete and robust sky system that will rise your project to another level. Azure[Sky] is not only suitable for projects with realistic graphics, in fact, this system is just as good or even better for projects with stylized graphics. You can achieve the best of each graphic style using Azure[Sky]. And its powerful sky system is turning 10 years of completely free updates in the Asset Store, thus making it the best cost benefit in its category.

Windows Demo: Download Link

Supported Render Pipelines:

  • Legacy: Yes
  • Universal: Yes
  • HDRP: No

Performance:
The performance is a factor taken very seriously in the development of the asset, and each feature was carefully planned to get the best performance as possible. It is not a tool targeted 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 as you can get using Azure[Sky].

Sky System:
The sky system is physically based, it supports a complete and dynamic day-night cycle. Azure[Sky] works as a skybox material, so you will get full advantage of Unity’s lighting system that uses the sky color to achieve the best scene lighting. The skybox supports rendering realistic stars, Milk Way and constellations.

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 your scene with the skybox. The plugin supports Global and Height fog, and the package includes instructions on how to edit your custom transparent shaders to implement support to the fog scattering effect.

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

Weather System:
The Weather System of Azure[Sky] is the most complete weather system you will find, believe me, there is nothing that can be compared to it.

You can literally add/create new custom ‘Weather Properties’ to the weather system by just pressing a button, then configure this weather property to be a FloatSlider, Colorfield, Curve or even a Gradient, etc
 This new weather property will appear in the weather presets for customization where you can set its values according to the time of day or even set a different configuration to it according to the weather preset you want to simulate.

The weather system will performs all the weather blends and transitions, and uses the output value of this weather property to control variables from other scripts using the ‘Override System’ without you having to write a single line of code. You can also arrange the custom weather properties in groups, so it became easy to organize all your weather properties according to its categories.

Changing the weather conditions at runtime is very simple, you can create a list of weather presets with a variety of different weather settings (Sunny, Rain, Snow, etc
). Then you can easily change the weather and all your scene settings by switching from one weather preset to another automatically using the global and local weather system. The weather system also provides a lightning effect and a complete sound/particle FX to simulate rain, wind, and thunderstorms. By default Azure[Sky] comes with a list of weather presets already configured to use.

Local Weather Zones:
Azure[Sky] also supports local weather zones, you can create a variety of different weather zones around the map, and as the player moves around the scene, the weather automatically changes according to each region.

Event System:
Azure[Sky] comes with a powerful event system completely integrated with the time of day and Unity’s Event System. There is also the AzureNotificationCenter class that handles a lot of useful events that you can use to integrate the Azure[Sky] logic with your game logic.

Cloud System:
Azure provides a dynamic cloud system with excellent performance and fully integrated with the weather system. You can also disable the clouds to only use the background sky if you want to use some third-party cloud shader.

Curves and Gradients:
Azure[Sky] was the first sky system to introduce the intensive use of curves and gradients to extend the asset customization power. It is possible to configure the custom ‘Weather Properties’ to be customized as curves and gradients, so you can set different values to the properties at any time of the day, providing total control over all the properties in your scene.

Override System:
The Override System is another innovation introduced by Azure[Sky]. You can configure it to get the output values from the custom ‘Weather Properties’ and use it to control variables from other scripts/components without having to write a single line of code. This feature is integrated with the ‘Weather Properties’ and the ‘Weather System’, and you can use it to integrate any sort of thing from your scene that need to work with the weather system.

Additional Features:

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

Important Warnings:

  • The asset is not targeted to mobile devices.
  • Currently, the sky system does not support HDRP.
  • The sky system does not support volumetric clouds and volumetric lights.
  • Not compatible with VRChat.
  • Not tested on VR, so I do not know if it works with Single-Pass Instanced Rendering.
  • Some assets from the images, videos and demo scenes belong to other Asset Store packages and are not included with this package.

Downloading and Updating:

  • Download the asset using Unity 2022.3.15f1 LTS or higher to get the 8x version cycle.
  • Download the asset using Unity 2021.3.43f1 LTS or higher to get the old 7x version cycle.
13 Likes

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.

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

cool one

The first version is now available in the Asset Store.

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.

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:

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.

1 Like

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!

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

Ok it looks much better now! I will push so we buy this now thanks!

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.

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:

half sunCosTheta = dot( viewDir, sunDir );
half moonCosTheta = dot( viewDir, moonDir);

to

float sunCosTheta = dot( viewDir, sunDir );
float moonCosTheta = dot( viewDir, moonDir);

or

float sCos = dot( viewDir, sunDir );
float mCos = dot( viewDir, moonDir);

half sunCosTheta = sCos;
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.

1 Like

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.

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.

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.

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.

Yeah although lets be honest, mobile is far from ready for intensive calcs in frag :smile:

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.
See an example:


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!

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

function setTime(time:float,dayDuration:float)
{
    v3.x = -((time) + UTC) * (60*DEGREES_PER_MINUTE)-90;
    if (dayDuration>0.0)
    {
       ROTATION = (DEGREES_PER_MINUTE * 1440) / (dayDuration * 60); //Gets the degree to rotate the sun according to the time selected
    }
    else { ROTATION=0; }
}

If you prefer you can change the Awake() to this:

function Awake()
{
   SkyUpdate();
 
   SKYMAT.SetVector("sunDir",-SUN.transform.forward);
   SKYMAT.SetVector("moonDir",-MOON.transform.forward);
   FOGMAT.SetVector("sunDir",-SUN.transform.forward);
   FOGMAT.SetVector("moonDir",-MOON.transform.forward);
 
   setTime(CURRENT_TIME,DAY_CYCLE_IN_MINUTES); // Set the start time of the day
 
   v3.y+=Longitude;
   MOON.transform.localScale.x*=-1;
   MOON.transform.localScale.y*=-1;
}

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:

function Start()
{
      setTime(12.0 , 0 );
}
  • 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:

if (Input.GetKeyDown("space"))
{
   target.setTime(17.5 , 10.0);
}

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:

#pragma strict
var target:azureSkyControl;   // Drag in ispector the GamObject that has the azureSkyControl script to this property
var TimeOfDay:float=6.0;      // 6:00 AM
var dayDuration : float =3.0; // New duration of day in minutes

function Update ()
{
   if (Input.GetKeyDown("space"))
   {
      target.setTime(TimeOfDay,dayDuration); // Using the function that is in the control script to set the time of day.
   }
}

In my tests it works very well.

Thanks !

Great thanks! I also added a checkbox in your editor so you can toggle the transition on/off

Two questions: How’s performance? Does it work with Horizon[On]?