Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Graphics Azure[Sky] - Dynamic Skybox

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

  1. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    (WIP)

    I have the Azure[Sky] Lite package practically complete, I've already finished making the static cloud shader and the clouds look very realistic.


    Now all I need to do is get some other cloud textures, the showcase scenes, videos and documentation.
    StaticCloud1.jpg StaticCloud3.jpg StaticCloud2.jpg StaticCloud4.jpg
     
    dashasalo, ftejada and TheGabelle like this.
  2. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    I definitely need the geolocation lat/long and dateTime with phase of the moon as i am doing the ultimate CAD AEC visualization VR toolset. I played with it a bunch last night as i know my way around procedural physical based sky settings regardless of what app they are in and got the sun and sky values looking realistic and artistic.. It was the Linear sky hiding the sun after it went above the horizon.

    A few things to note. Changing the DayCycleInMinutes in the Inspector at runtime did not change anything. I had to set it in Edit Mode and then go into Play to have the cycling occur. i will be doing this in script and wonder if it will be picked up or if that variable is only settable from the Editor. In Linear mode the clouds almost disappear into the sky. I set it to Linear To Gamma and the clouds pop like they should. Beautiful wispy clouds generated by a normal map it appears. I tried some of the other noise based normal maps hanging about from effects and it was obvious you need some resolution to the normal map. What are your suggestions about how to go about making cloud maps if I have several type of normal maps generator. It looks like you plugged RGB noise into yours and blurred it into each other to remove harsh transitions.
     
  3. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Changing the day's cycle during gameplay does not make much sense, so this value is chosen before running the scene. In fact, the variable responsible for the duration of day cycle is the variable: public float PassTime

    The variable "DAY_CYCLE", which appears in the Inspector as Day Cycle in Minutes, is used only as an argument to the method: public void SetTime(float hour, float dayDuration)

    If you want to change the day cycle length at runtime, then you need to change the value of the "PassTime" variable. Or rather, the SetTime() method does this for you, just call the SetTime() method at the moment you want to change the duration of the day cycle, for example:
    Code (CSharp):
    1. if (Input.GetKey ("enter")) {
    2.     SetTime (TIME_of_DAY, 1.0f);
    3. }
    This code above will set the duration of the day cycle to 1 minute when pressing the "enter" key and will keep the current time of day, if you wish to change the time of day as well, then change "TIME_of_DAY" by a float value between (1.0f - 24.0f).

    Or

    If you want the day cycle length to change at runtime according to the value set in the Inspector, then just add that line of code inside Update().
    Code (CSharp):
    1. SetTime (TIME_of_DAY, DAY_CYCLE);

    //-------------------------------------------------------------------------------------------------------------------------------------------


    The texture of dynamic procedural clouds is not a normal map, the colors look like a normal map, but it's because on each RGB channel it has a different grayscale noise.

    You can open the texture in Photoshop or Gimp and view each RGB channel separately to understand how they are made. There is no ideal way to create this texture, I just randomly added a different noise map on each RGB channel. It will even depend on "random chance" whether the clouds will be good or not!


    //-------------------------------------------------------------------------------------------------------------------------------------------


    Azure3x was made in the Gamma color space, if you are using linear color space, you need to convert Azure to Gamma, so that the sky and clouds stay as they should be. So you need to set the "Space Color" property on the "Options" tab to "Linear To Gamma". If you are using the Gamma color space, then leave it in Azure as "Default".
     
  4. Wurlox

    Wurlox

    Joined:
    Nov 1, 2015
    Posts:
    50
    @_7stars Wow! This looks really amazing. Can't wait to see some videos or a demo to watch Azure Sky in action. Did you use only Unity's new Post Processing stack for your screenshots or any other assets? Keep up the amazing work :)
     
  5. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Since I am using this for archviz VR the ability to freeze the time or have it cycle over a user chosen time gave the architects the ability to see how light from a physical sky plays on their structure and through the building portals, windows etc. through a night day cycle and freezing it allows them to take screenshot of a time of day and adjust the sky scattering values and cloud cover as they wish for composition sake. Linear still makes the clouds disappear in Procedural WispyCloud mode as compared to gamma so i left it in gamma and adjusted values accordingly. Looking forward to the update to get the other physical sky model, correct phases of the moon per day and geolocation coordinates. Great work so far and I am certainly impressed. Do you have an estimate on arrival time or can I get a beta?
     
  6. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    Hi _7stars,

    Does Azure[Sky] come with networking for use in multi-player games?
     
  7. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    It is a skybox with parameters. Pass the parameters. Jeesh. Some of the questions.
     
    summerian likes this.
  8. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    I know we could pass the parameters. I'm asking the author if networking hooks are a part of his asset since other time of day assets that we are evaluating offer them which will save us time/money, but thanks for the smart-ass comment.
     
    Last edited: Apr 26, 2017
  9. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    There are hooks. Network them. time of day is included with hour and with minutes as a per cent of an hour. & day week setup and controllable cycle. Everything is controllable as all great assets should be. I don't need my hand held. Just give me the bare bones and muscle and I'll add the fat. I am using it for multiuser archviz VR. BTW..yer welcome..Jeesh.
     
    summerian likes this.
  10. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    I really hope you don't support your own asset store products with that kind of attitude.

    @_7stars Apologies for this little back and forth. If you could answer my question, it would be greatly appreciated. :)
     
  11. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Yes, I am only using the Unity post processing stack.

    I'm already doing the showcase videos and test scenes, so when the video is ready I'll post here so you do not have to wait until the asset store release.




    All that remains to be done is documentation, test scenes and videos so that I can send Azure[Sky] Lite to the Asset Store.

    As the name already says, Azure[Sky] Lite will not have all the advanced features that will be available in Azure[Sky] Dynamic Skybox. As soon as I submit Azure[Sky] Lite to Asset Store, I'm going to use Azure[Sky] Lite as the base to make the new Azure[Sky] Dynamic Skybox version and immediately I'll start adding advanced features like:
    • 7 different days to customize. (Already in Azure 3x)
    • Real position of sun and moon based on time, date and location.
    • Realistic fog scattering. (Already in Azure[Sky] Lite)
    • SDF Moon sphere, to avoid the use of RenderTexture.
    • Etc...

    These are the first advanced features I'm going to add, so when those features are integrated I can send the package for you to use until the other features are integrated and updated in the Asset Store.

    It's hard to put a date because I can not predict things that can go wrong. I am working hard and hopefully it will be possible to add these features until the end of May or early June. I thought I would end Azure Lite only at the end of May, but I finished earlier than expected, I just hope that the documentation and promotional videos do not cost me much time.



    Hi!

    If there is one thing I do not understand, it is about multiplayer and Networking. And this is not available in Azure.

    But if you have someone on your team who understands this, I think it will not be so difficult for this person to make Azure work in a Multiplayer game, because the only thing I think would need to be the same for all players is the "time of day", the rest of the sky, effects, curves and color gradients all work and change based on the variable that controls the time of day.

    If you get Azure, I will not be able to give you the necessary support, because as I mentioned, I do not understand about this!





    - Denis Lemos
     
    Bartolomeus755 likes this.
  12. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    I think you do not understand much about multiplayer networking. Anything can be run in multiplayer and have it be the same across clients if you all use the same systems or frameworks and assets and the same variables which are passed and use the server as the author and tracker of those variables across clients. I hope you don't approach your multiplayer game with such a ladeedah attitude as your questions belie. You should not expect any asset maker to make his assets multiplayer network ready unless advertised particularly for that use. And my assets do not need support. They work as advertised.
     
    summerian likes this.
  13. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    Fair enough. Thank you for the reply, Denis.


    Listen, I'm trying really hard here to take the high road but enough. I wasn't expecting anything, I was simply asking a question.

    You butted in with a condescending response when my question was clearly not for you and now you're saying you don't need to support your own assets when they have two star averages and comments in your reviews like "Promising concept, disapointing support" clearly show otherwise. Best of luck, ippdev.
     
  14. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    ftejada likes this.
  15. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Yeah..From someone wanted me to make it work with some other system which required tearing both apart. Someone much like yourself actually. It worked as advertised:) I do not rely at all on the Asset Store. I make my income as a senior VR engineer at a top AEC firm. Now..I am trying to take the high road here and not hijack this brilliant man's thread on his wonderful product that is the best damned live skybox i have ever seen in 35 years of doing this stuff. Buy it and use it in your multiplayer game.
     
    summerian likes this.
  16. Wurlox

    Wurlox

    Joined:
    Nov 1, 2015
    Posts:
    50
    @_7stars Oh my gosh - just take my money :)

    Seriously that is looking really amazing. Will buy as soon as it is on the asset store. We are currently developing a game with a magic setting and I think Azure Sky is just perfect for this as it gives a very mystic feeling like no other asset I've seen so far. The moonlit nights are a highlight and look like in the movies. In our game there will be an island floating in the skies and I can't wait to see it being light up from Azure Sky.

    Do you have a trello board or can you give more insight in what you have already planned for the Azure Sky Dynamic Skybox version? I really want to support this asset and give some feedback once I tested it.

    Keep up the good work.
     
  17. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Thank you!

    As soon as I send Azure[Sky] Lite to Asset Store, I'll immediately resume the development of Azure[Sky] Dynamic Skybox 4x.

    What I have planned for Azure[Sky] Dynamic Skybox is:

    V.4.0
    • All existing enhancements and features in Azure[Sky] Lite will be present in version 4.0.
    • Realistic positioning of the sun and moon based on time, date and location. This feature I already have running on another test project.
    • SDF moon sphere to bypass the use of RenderTexture and mesh sphere in the scene. This feature I already have running on another test project. See more: post #386
    • 7 different days to customize, this is already implemented in Azure 3x, but Azure[Sky] Lite has only one day available.
    • 2 fog modes to use (Realistic - Projected).
    • Hoffman & Preetham sky model improvements.
    • Cloud system improvements.
    • Performance improvements.

    V4.1

    V4.2
    • Volumetric fog.
    Of the above items, what I will have more work and will take more time to do are volumetric clouds and volumetric fog. The volumetric clouds I already have running on a test project, but it is still precarious and with a low performance.


    - Denis Lemos
     
    StevenPicard, v_James_v and ftejada like this.
  18. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    More video available!
    This video shows a simple use of the Output System available on Azure[Sky] Lite. With the Output system it is possible to control elements of your game based on Azure time of day. In the video, the Output system is used to control the intensity and color of the spot lights and also the lighting of the building's windows.

    The 3d assets used in the video are from the Simple Town Lite package: https://www.assetstore.unity3d.com/en/#!/content/43480


     
  19. Wurlox

    Wurlox

    Joined:
    Nov 1, 2015
    Posts:
    50
    Thanks for clarifying what's on your roadmap. This looks very promising. Our game will greatly benefit from Volumetric clouds (sky island) so this is a feature we hoped that it will be implemented.

    Thank you for sharing a new video that shows what can be done with some coding. Really straight forward and easy to understand. Looking forward to future updates. As you can see I always keep track on them ;)

    Regards,
    Wurlox
     
  20. oliran

    oliran

    Joined:
    Sep 29, 2015
    Posts:
    49
    Hi,

    I am getting weird behavior from Azure[Sky] 3.0.4 on Unity 5.6. The Sun gets rendered completely black. I just imported Azure into my scene and you can see the effect in the screenshots. Any ideas on what may be going on?

    EDIT: Thanks to dev I realized that the moon texture was the problem. Somehow Unity didn't import it correctly. I deleted it and reimported and now it works great!

    Thanks,
    Omer
     

    Attached Files:

    Last edited: May 4, 2017
  21. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Hi Omer!

    Check your email, I just answered you there!
     
  22. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Azure[Sky] Lite

    I already have two scenes available for testing, now I only need to do the documentation that I intend to finish between today and tomorrow, to then send the package to the Asset Store.




    Test Scenes
    At the moment I can only compile for Windows, so you need to download and run locally.

    Controls
    Right Mouse: Move the camera.
    Mouse Wheel: Zoom.

    Azure[Sky] Lite - GI Scene

    DOWNLOAD CLICK HERE!


    Azure[Sky] Lite - Aerial Perspective

    DOWNLOAD CLICK HERE!



    Performance
    Unfortunately after all the features added and the package finished, mobile performance was not as good as it should be. On my test device (Motorola Moto G2) the performance was:
    • Without clouds: Runs at (40-45) frames per second.
    • With clouds: Runs at (25-28) frames per second.
    This is a good performance due to the sky system's complexity, but it is not an acceptable performance for mobile devices, so I can not promote it as mobile friendly. To make the sky system mobile friendly, I'll need to do a more simpler version. I have some ideas using pre computed textures, but I'll work on it only after I release the Azure[Sky] Dynamic Skybox 4x updates.



    On the other hand the performance is far superior compared to Azure[Sky] Dynamic Skybox v3.0.4. I do not have much experience in using Profiler, so the results I got were these:

    Azure[Sky] Dynamic Skybox v3 - controller script
    Script Update - V3.0.4.jpg

    Azure[Sky] Lite - controller script.
    Script Update - Lite.jpg

    Azure[Sky] Dynamic Skybox v3 - Skybox
    Skybox - V3.0.4.jpg

    Azure[Sky] Lite - As Skybox
    Skybox - Lite.jpg

    Azure[Sky] Lite - As Skydome
    Skydome - Lite.jpg
     
    Last edited: May 4, 2017
    Farelle and ftejada like this.
  23. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Does this system support multiple moons/suns?
     
  24. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Hi!

    Azure supports only one sun and one moon. Multiple suns would not be nice for performance and I still have not found a good method for implementing multiple moons that suits the Azure's operational mode.
     
    summerian and ksam2 like this.
  25. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    (WIP)

    I just sent yesterday to the Asset Store the Azure[Sky] Lite package. Now the package is in pending review awaiting the evaluation by the Asset Store team. The package can laver a few days to be available at the Asset Store.​

    As promised, I immediately started working on the new Azure[Sky] Dynamic Skybox update. As you can see in the screenshots below, the sun and moon positioning system based on time, date and location is already implemented.

    You will be able to choose between two modes of time control: Simple and Realistic.

    Simple mode: The position of the sun and the moon will be based only on the time of day, by default the position of the moon will always be the opposite side of the relative sun position.
    Simple Time.jpg



    Realistic mode: The position of the sun and moon will be based on the time, date and geographical location. And the moon's phases will automatically adjust depending on the relative position of the sun to the moon.
    Realistic Time.jpg

    But, I has found a problem that will give me a headache to get around.

    In Simple time mode, the sun/moon rises and sets always at the same time of day. For example: The sun always rises at 6h and always sets at 18h, so the setup you set in the curves and gradients for that particular time will always match the exact position of the sun and the moon in the sky.

    The problem is when you set the time mode to Realistic. Depending on the geographical location and date, the sun and moon will be in different positions and the setup you set in the curves and gradients will no longer match with the position of the sun and moon in the sky.

    For example: If you set a value in curves and gradients to the sunset(at 18h) and then change the date or location, the sunset will no longer be at 18h, and may be at 20h, 21h, etc. ... It will depend on the position in the world that you set. Then the value that you previously set for sunset at 18h, will be affecting a different time of day and no longer the sunset.

    For this reason, when the time mode is set to Realistic, the curves and gradients will not be adjusted in line with the time of day, instead I intend to create a system for the values of the curves and gradients to match with the elevation of the sun and moon in the sky. So you will for example, set the intensity of the directional light of the sun based on the altitude where the sun is in the sky. You set a value for when the sun is rising on the horizon and another value for when the sun is at the top of the sky or below of horizon line. As the day progresses, the value changes smoothly depending of the altitude.


    The downside is that as values will depend on the altitude of the sun and moon, the value will be the same at sunrise and sunset. You will not be able to set a value for the sunrise and another diferent value for the sunset, just as it would be if It was based on the time of day like in the Simple time mode.



    - Denis Lemos
     
  26. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Perhaps you can create a multiplier curve that changes based on the geolocation and time of day and the other values remain as per simple time but get multiplied by that curve?

    Another request I think you have had prior. When lightmapping using skybox, because everything below the horizon is the horizon color..generally whitish.this makes the underside of objects look like they are lit from below. It would be helpful to have a ground color for using the skybox as the ambient lighting mode. I had to switch to Gradient to get darkness on the underside of objects but would much prefer your beautiful sky to light the scene instead of my approximations.
     
    Last edited: May 7, 2017
  27. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    I do not know if this would be possible because there are many different configurations possible and it would be very difficult to predict a value for this multiplier, not to mention that in every location in the world, the daytime and night have different durations and many time variations of sunset and sun rise. Also the position of the moon varies greatly from one day to the next and it would be impossible to correctly adjust the curves that control the properties related to the moon.

    The configuration by elevation, I am almost 100% certain that it will work, I have already done some quick tests here and it seems that it will work properly, it will be possible to set a different value for each position of the sun and the moon in the sky. The process is very similar to the current one, but as I mentioned before, the only downside is that sunrise and sunset will have the same value because it is based on the height of the sun/moon in the sky.


    This has already been implemented in the Azure[Sky] Lite package, currently under review at the Asset Store. And will also be present in the new update of Azure[Sky] Dynamic Skybox that I am currently working on. You can download the "GI test scene"(Windowns only) from Azure[Sky] Lite a few topics above to see it working. Try to take a look at the demo scene.

    Now, the skybox ground color adapts to day time and gets very nice at night.


    [Edited]
    Here a screenshot at night of the Global Illumination with the ambient source as skybox.
    GI.jpg

    [Edited2]
    Here a screenshot at daytime of the Global Illumination with the ambient source as skybox.
    Day GI.jpg
     
    Last edited: May 8, 2017
  28. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    (WIP)
    Yes it works!

    I implemented the system of curves based on the elevation of the sun and moon in the sky and worked perfectly with Realistic time mode. I've put an option for the user to choose which curve mode he'll want to use. In this way it will be possible to use the curve mode based on the elevation of the sun/moon even in Simple time mode.

    In my opinion, the curve mode based on the elevation of the sun/moon was much easier and faster to customize the sky system than the curve mode based on the timeline!
    Curve Mode.jpg


    [Edited]
    Now it will also be possible to define whether each curve or gradient created with the Output System will be based on the timeline, sun elevation, or moon elevation.​
     
    Last edited: May 9, 2017
    ippdev, Crossway, ksam2 and 1 other person like this.
  29. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Cool, I've been waiting a long time for the new version to release.
     
  30. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    I apologize for the delay in updating Azure[Sky] Dynamic Skybox and thank you all for understanding and patience in waiting. But this delay is for a good reason, I am working many hours a day and doing my best to make Azure the most complete sky system of the Asset Store and thereby make your choice in using Azure the right choice.​

    In Azure[Sky] Dynamic Skybox 4x development I have redone the package from scratch a couple of times until I found the ideal way to make Azure works. And that ideal way was Azure[Sky] Lite, which I already sent to the Asset Store.

    With the structure of Azure[Sky] Lite already made, it was very easy to add the advanced features that will be available only in Azure[Sky] Dynamic Skybox. And that made the job faster than I thought, and the first Azure4x update is ready.

    All I need to do now before sending the update to the Asset Store is to do the documentation, sample scenes and advertising material.

    I'm very satisfied with the result, and very enthusiastic because it has many nice features to come in the next updates.

    List of some features that will be available in this first Azure4x update.

    • Preetham sky model completely redone.
    • Fog Scattering completely redone.
    • Two fog modes. (Realistic and Projected)
    • Time mode completely redone.
    • Two time modes. (Simple and Realistic)
    • Actual position of the sun and moon based on time, date and location. With the correct number of days in each month, including leap year.
    • Two curve modes and gradients. Based on the timeline and elevation of the sun/moon.
    • New stars system. Now only one cubemap texture is used for the stars and the Milky Way(Deep Space). The positions of the stars are based on the brightest stars in the texture of the Milky Way, making the Azure stars much more realistic and correctly distributed across the sky.
    • New Inspector interface, more organized and easy to customize.
    • Two cloud modes that you can turn on and off with simple clicks on the Inspector, including cloudless mode(empty sky). More cloud modes will be added in the next updates.
    I had some last-minute issues that prevented me from implementing the SDF moon sphere. And to not waste time now trying to solve them, I'll leave to implement this feature in a next update. The phases of the moon adapt correctly with the date and seasons, so this will not be a problem, the only difference is that you will still need to use a RenderTexture. For those who care about performance, I've put the option to use a simple texture of the moon instead of using RenderTexture.

    A beautiful image of the horizon using the projected fog mode and 2D dynamic clouds.
    Projected Fog.jpg
     
    Crossway, ftejada, ippdev and 2 others like this.
  31. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    283
    Looks and sounds great, looking forward to the new update. Great work so far!
     
    DenisLemos likes this.
  32. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    (WIP)

    I'm currently creating the demo scenes, and would like to share a simple detail, but that makes all the difference when it comes to adjusting scene lighting.

    To make the scene illumination in Azure, is used a directional light linked to the moon and other directional light linked to the sun. The intensity control of the directional light of the sun and the moon is made by curves, so the intensity must be set to zero when the sun or moon crosses below the horizon. This way the directional light of the sun does not illuminate the scene when it is night and the moon does not illuminate the scene when it is day, and the main one, it prevents that it has two directional lights active at the same time, which is bad for the performance.

    But setting the intensity of the directional lights to zero exactly when the sun and moon rise and set, is a rather tedious task. So I made a small change in the script to set the intensity of the sun's and moon's directional lights automatically when they cross down the horizon. It is also possible to set the transition speed to make the intensity of the directional light decrease more smoothly or abruptly. Now the transition from day to night and vice versa is more accurate and realistic.

    The way you set the intensity values of directional lights on the curve does not change, you'll customize how you normally would, the difference is that you will not have to worry about turning off and turning on the sun/moon light as this will be done automatically.

    At the same time, this solves a small problem that could occur when using realistic time mode. In realistic time mode, you must use curve mode based on the elevation of the sun or the moon. The intensity of the directional light of the moon and also the brightness of the moon in the sky must be based on the elevation of the "sun", because it is the sun that defines when it is day or when it is night and this also prevents the moon from shining and illuminating the scene at daytime. Because the intensity of the directional light of the moon is based on the sun elevation, logically must set the moon to shine in the sky and illuminate the scene when the sun is below the horizon(when is night). But depending on the date and season of the year may happen that the sun and the moon stay below the horizon line and consequently there is no moon at night.

    So this little change in the script to set the intensity of the directional lights to zero automatically when the sun or moon is crossed below the horizon, avoids that the directional light of the moon illuminates the scene when it is night and there is no moon in the sky.

    I was playing with this right now and the realism of the lighting is getting incredible, especially at night, because the change in lighting when there is no moon in the sky and suddenly the moon appears on the horizon is amazing!



    I do not know if it will be possible to perceive by images, but when I make available the demonstration scene it will be possible to observe in more detail.

    Night scene with no moon in the sky, an instant before the moon rises on the horizon.
    Note that the only source of illumination is from GI with the ambient source lighting as skybox and intesity set to 0.25f.
    Note also that the intensity of the directional light of the moon was automatically set to zero to prevent directional light from illuminating the terrain from the underside.
    NoMoon.jpg


    The same night scene an instant after the moon rises in the sky.
    Note that the intensity of the directional light of the moon has automatically changed to the value set in the curve and now the moon illuminates the whole scene.
    WithMoon.jpg

    Thanks if you've read this far!
    - Denis Lemos
     
  33. RichGarcia

    RichGarcia

    Joined:
    Mar 6, 2015
    Posts:
    7
    That's great news about the 4.0 update. We look forward to using it in our product.

    BTW, we noticed that the moon rendering takes 1 ms per frame on the Xbox One, so we appreciate that you have added the option to have a "simple" moon instead.

    Thank you,
    Richard
     
    DenisLemos likes this.
  34. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    I created the demonstration scenes and now only I need to do is the documentation to be able to send the first update of the Azure[Sky] Dynamic Skybox 4x cycle to the Asset Store.

    I'll leave the demo footage links here for anyone who wants to test. The demos are for Windows only!

    Aerial Perspective
    In this demonstration scene you can switch between the different modes of fog, clouds, time and days of week.

    Note that on each day the sky has a different customization and lighting. It is possible to define a huge verity of customizations, from sunset to even brighter or completely dark nights. Also, no post-processing effect is used, but you can enable the post-processing effects achieved with the Unity's Post Processing Stack.

    If you change the time mode to realistic, the position of the sun and moon will be based on the time, date and geographic location that I have previously defined. I chose a date and location that is possible to observe in the same cycle of day the moon in the sky at daytime, at night and also the night without the moon in the sky.
    Then between 0h and 1h you can see the moon rising in the night sky and observe the change in the illumination of the scene. Between 05h and 06h the sun rises and you can observe the transition of the moon from night to day and from there to see the moon at daytime. You can also observe how the phase of the moon adjusts automatically according to the position of the sun in the sky.
    https://drive.google.com/open?id=0Bwu19sA7OALeWFA2bE9GNlBUVjA


    GI
    In this demo you can see how global lighting behaves using the Azure skybox as the ambient light source. In this demo scene the Unity Post Processing Stack is used.
    https://drive.google.com/open?id=0Bwu19sA7OALeRC1hSVB0VlFGdEU


    The terrain used in the Aerial Perspective scene is from Horizon[ON].​
     
  35. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Azure[Sky] Lite is now available in the Asset Store!
    https://www.assetstore.unity3d.com/en/#!/content/89858

    The first update of Azure[Sky] Dynamic Skybox 4x has already been submitted and is in pending review awaiting approval from the Asset Store team. This is the last chance to get Azure[Sky] Dynamic Skybox for $45, the price of this first 4x release will be $50 and it will rise more with future releases, the final price of Azure4x will be around $65.

    In the last 2 months I've been working exclusively on Azure for about (6-10) hours per day, so if you like the new update, please rate and write a review, this is a great help to keep Azure always up to date!




    Now I'm going to work simultaneously on my other projects and also on upcoming Azure4x updates.
    For 4.1 I plan to add:
    Weather control
    Proland Sky Model
    Volumetric Clouds


    Ps: I'll be editing the main topic soon to report the differences between Azure[Sky] Lite and Azure[Sky] Dynamic Skybox and also fix some links to images and demo scenes that are broken.
     
  36. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    283
    Great news, thx for your hard work on these amazing assets!
     
    DenisLemos likes this.
  37. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Excellent. This is the best sky out there and I have been awaiting this new build for the archviz program I am under contract to complete. The first important function being correct geolocation sunrise, traversal and sunset and to get rid of the white "ground" on the skybox which tints the underside of objects with a Standard shader the horizon color at fresnel grazing angles or generally whitish..which is not good in archviz.
     
    DenisLemos likes this.
  38. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi _7stars

    A question...

    The new version of Azure 4.0 can be used with versions of unity 5, inferior to the 5.6.0f3 ???

    regards
     
  39. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    My impression is that it is an even more realistic physical sky and performance is better. I have it running in 5.6.0f3 and 5.6.1f1
     
  40. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    No! If you import in a version inferior to Unity 5.6 the materials, scenes and prefabs will not be recognized equal always happens when trying to regress a project created in a superior version. The latest versions of Unity also have many changes in the lighting and coding of shaders and scripts that will not be compatible with previous versions. So I kept the multiple versions in the Asset Store and when you are using a version lower than 5.6 will download and import Azure 3.0.4.

    My first intention was to make Azure4x on Unity 5.3.4, but this version of Unity was already outdated, I noticed this when I installed unity 5.5. My second intention was to make Azure on Unity 5.5, but there were a lot of problems and bugs that made it impossible for me to work with this version of Unity. So I installed Unity 5.6 and everything worked very well and consequently this is the minimum version required to use Azure4x.

    And frankly, I see no reason for developers to continue using previous versions of Unity. I only recommend backing up the projects before installing a newer version.
     
    ftejada likes this.
  41. Georacing

    Georacing

    Joined:
    Nov 10, 2016
    Posts:
    4
    Hi ! Thank you for this wondeful asset !
    But i have 2 problems :
    I have a custom Ocean shader apply on a big plane, and this causes an artefact with the fog.

    Or when the waves are above the horizon :

    I used the UNITY_APPLY_FOG function in my Ocean shader, but this does'nt fix it?.
    And how can i set the coverage of cloud at 100% ?

    (Sorry for my english)

    Thank you again !
     
    Last edited: Jun 2, 2017
  42. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @_7stars

    Well tell you several things ...

    I think that the daylight gives better results regarding Azure x3 (I do not know if you remember that I said something of that in the forum) and the results I like a lot more. I suspect that maybe it was something related to the fog in version x3

    I am still testing Azure x4 more thoroughly but I can not dominating the night illumination. With Azure x3 I got super spectacular results in the lighting and appearance of the nights, but with Azure x4 it's costing me more ...

    I've detected a bug (I think).
    When I make daughter the camera of Azure x4 and change the tag to the one of MainCamera, the position of the gameobject that contains Azure x4 begins to move without stopping. It happens without giving the play. I also have not tried if it happens to put the camera another tag.
    I did this before with Azure x3 and it never gave me problems ...

    On the other hand I'm having a fairly important problem (although I think it's not Azure's problem).
    It is with the lighting in the PlayWay Water system. I think you should have that asset since one of your demos was with him, so I expose the problem because you can test it too.

    I have put the problem in the PlayWay Water forum but the developer has stopped giving support and I do not know if anyone can help me.

    The problem is that when I make a dark night and the sun begins to rise at dawn the water suddenly lights up. Instead of doing it gently. I leave you a video so you can see what I mean.

    The first time I play in this video it seems to work fine. But when I repeat the dawn, the problem always appears. And it looks very bad.



    Do you have any idea why it might be?

    Regards
     
  43. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Azure fog will only work on objects that draw to the depth buffer. You need to make your water draw properly in the depth buffer if you want the water to be hit by fog scattering. Usually most of the transparent shaders do not draw in the depth buffer, so the fog may behave oddly sometimes.

    You have two options:
    * The first option is to make your water shaders draw to the depth buffer.
    * The second option is to uncomment the "[ImageEffectOpaque]" command in the "AzureSkyFogScattering" script. This causes the fog to be applied "before", of the objects that are in the "Transparent" queue be drawn on the screen.
    https://docs.unity3d.com/ScriptReference/ImageEffectOpaque.html
    Note that using the command "[ImageEffectOpaque]" the fog scattering will ignore the transparent shaders, even if they draw to the depth buffer.

    The cloud system is not yet complete, so the 2D dynamic clouds of this new version do not have full coverage. This will be implemented along with climate control and volumetric clouds, which will be able to control the cloud cover and also create overcast sky. In Azure 3.0.4 an interim system has been implemented, which may not be satisfactory in all cases.
     
    Georacing likes this.
  44. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    The way to customize the night sky is pretty much the same as in the 3x version. The difference is that you no longer need to customize the ground color of night sky, because now the color of the sky ground is automatically adjusted based on physics.

    Note that the physics-related properties of the night sky are now in the "Scattering" tab. The properties that influence the night sky scattering are:
    Rayleigh;
    Rayleigh Color;
    Night Intensity;
    Exposure;





    I did not understand the process you did for the camera bug, I tried it here and it is working normally. But now you do not need to associate the Azure prefab with the player and not even with a camera. Azure will automatically position itself in the same position of the camera with the MainCamera tag, if you have several cameras with the MainCamera tag, Azure will position itself in the position of the first existing camera tagged as MainCamera. If you want to change the camera, then you need to deactivate the first MainCamera that Azure will automatically position itself in the position of the second MainCamera and so on.
    This happens to sync the sky with the camera when using sky mode as a skydome. So the camera is always in the center of the skydome and the skydome is always visible from the camera. It also makes the effects like lens flare and sun shafts stay correctly aligned with the position of the sun and moon in the sky.
    If you do not want this to happen, just uncheck the "Follow Active Main Camera" in the Options tab.





    I tested here with PlayWay and the lighting was working normally with no problem, but I noticed I was using DirectX9. Try switching to DirectX9 and take the test again, I think it will work correctly as it worked here. PS: I used the same date, time and location setting shown in your video.

    When I switched to DirectX11, the same problems happened. The problem seems to be with PlayWay and I think I know what it might be, but I do not know if it will be possible to solve it.


    Note that the problem seems to only happen when there is no active directional light in the scene. For the date, time and location you are using, there is no longer the moon in the sky before the sun rises. If you change the time mode to simple, the lighting should work normally, because in this mode you will always have an active directional light in the scene.

    In DirectX9 everything is working properly as it should, even when there is no active directional light in the scene, at night the water looks very beautiful.
     
    ftejada likes this.
  45. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi 7_stars

    Hi

    I'm going to try all this these days and tell you how it went.

    Greetings and thank you
     
  46. Georacing

    Georacing

    Joined:
    Nov 10, 2016
    Posts:
    4
    Thank you ! i'll try this ;)
     
  47. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695

    Hi again !!

    I just tested the problem of lighting with PlayWay Water and you were right. This is a problem when DirectX11 is turned on.

    With directX9 it works phenomenally. The problem for me is that I have some assets that do not work with DirectX9. So I have to find a suitable solution for me.

    I have tried the alternative solution that told me with DirectX11 and solves the problem at dawn. But with Time mode = simple it happens at dusk.

    I do not know if it's because of the Azure my configuration, but when the sun goes down at dusk several frames pass until the moon is activated ....

    I have tried to change the time at which the light intensity of the sun starts to drop and change the time in the Moon's Light Intensity. For example, I have since the intensity of the sunlight begins to lower at 7:00 p.m. and reaches 0 at 8:00 p.m.
    And the moon equal

    But the sun begins to lower the intensity before the 17 and the 18h always happens the problem that several frames remain with the directionaLight of the sun deactivated and the one of the directionalLight of the moon also deactivated.


     
  48. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    That's wierd. I just get 3fps with new Azure and unity 5.6.1! Something must be wrong.

    I've figured out if you have a big ground (25 tiled terrains) then azure performance will be awful (less than 3frames)
     
    Last edited: Jun 2, 2017
  49. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    This is because Azure now turns off the directional lights automatically when they cross below the horizon to prevent the scene from being lighting from the bottom up. So you can maintain a linear value in the curves, that even then the intensity of the directional lights of the sun and the moon will decrease autimatically until reaching zero.

    In this case the directional light will only illuminate the scene when it is above the horizon line. These frames, as you have already observed, are in the short interval of time when the sun sets and the moon rises. It does not matter much what you set in the curves because the light intensity will automatically decrease as the light crosses below the horizon and vice versa.

    What you can do is remove the snippet of code that makes the directional light from the sun turn on and turn off automatically, but in that case you will need to set the exact moment for that to happen on the curve. I have tested here and this will solve the problem in simple time mode, but in real time mode will continue to happen because we know that depending on the date and location there may be no moon in the night sky.

    Open the AzureSkyController script and edit this piece of code inside the "AzureLighting" method.
    Code (CSharp):
    1. switch (Azure_CurveMode)
    2. {
    3. case 0:
    4.     Azure_SunLightIntensity = Azure_SunLightIntensityCurve [Azure_DayOfWeek].Evaluate (Azure_GetCurveTime) * Azure_SunRise;
    5.     Azure_SunLightComponent.intensity = Azure_SunLightIntensity;
    6.     Azure_SunLightComponent.color = Azure_SunLightGradientColor [Azure_DayOfWeek].Evaluate (Azure_GetGradientTime);
    7.      break;
    8. case 1:
    9.     Azure_SunLightIntensity = Azure_SunLightIntensityCurveE [Azure_DayOfWeek].Evaluate (Azure_GetCurveSunElevation) * Azure_SunRise;
    10.     Azure_SunLightComponent.intensity = Azure_SunLightIntensity;
    11.     Azure_SunLightComponent.color = Azure_SunLightGradientColorE [Azure_DayOfWeek].Evaluate (Azure_GetGradientSunElevation);
    12.     break;
    13. }
    To this:
    Code (CSharp):
    1. switch (Azure_CurveMode)
    2. {
    3. case 0:
    4.     Azure_SunLightIntensity = Azure_SunLightIntensityCurve [Azure_DayOfWeek].Evaluate (Azure_GetCurveTime);
    5.     Azure_SunLightComponent.intensity = Azure_SunLightIntensity;
    6.     Azure_SunLightComponent.color = Azure_SunLightGradientColor [Azure_DayOfWeek].Evaluate (Azure_GetGradientTime);
    7.      break;
    8. case 1:
    9.     Azure_SunLightIntensity = Azure_SunLightIntensityCurveE [Azure_DayOfWeek].Evaluate (Azure_GetCurveSunElevation);
    10.     Azure_SunLightComponent.intensity = Azure_SunLightIntensity;
    11.     Azure_SunLightComponent.color = Azure_SunLightGradientColorE [Azure_DayOfWeek].Evaluate (Azure_GetGradientSunElevation);
    12.     break;
    13. }
    Note that only the Azure_SunRise multiplier has been removed from the code. Now the directional light of the sun will no longer decrease and increase the intensity automatically and you should do so by editing the curve on the "Lighting" tab.

    You can do the same for the directional light of the moon, but I recommend leaving the moon automatic.
     
    ftejada likes this.
  50. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Really, this is very strange because Azure has nothing related to terrain or any other type of object in the scene or even the amount of them in the scene. Azure works independently, and as long as the skybox is active in the scene, the cost of Azure's performance should be the same regardless of the size of the scene or the number of objects in the scene, Azure's calculations will always be the same.

    I did not test with tile terrains, but I tested here with a terrain of 100km x 100km in size and everything worked normally.