Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Azure[Sky] - Dynamic Skybox

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

  1. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    248
    Hey Denis,

    Thanks, i'm using the old version for this scene now, because my scene is very heavy and my computer slow.
    When i press play i have to wait literally 2 minutes until it starts. The same when i stop it, so testing is very exhausting and the old version looks pretty decend for what i want.

    So, the day-night cycle is running very well, but i need to interact and pause it or continue it when paused at the same mark. So like a pause button on the videorecorder, freeze the cycle with a click and with another click keep it going further. Is that possible and can you help me with that code for 4.1.2?
    Thank you again!
     
  2. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    This script stops and starts the time progression of the old(v4.1.2) sky controller every time you press the "space" key. You can call the "StarStop" method from anywhere, for example using the OnClick event of a UI button.
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3.  
    4. public class TimeControl : MonoBehaviour
    5. {
    6.     public AzureSkyController skyController;
    7.     private bool isMoving = true;
    8.     private float startDayDuration = 0.0f;
    9.  
    10.    void Start ()
    11.    {
    12.         startDayDuration = skyController.Azure_DayCycle;
    13.    }
    14.    
    15.    void Update ()
    16.    {
    17.         if (Input.GetKeyDown("space"))
    18.         {
    19.             StartStop();
    20.         }
    21.    }
    22.  
    23.     public void StartStop()
    24.     {
    25.         if (isMoving)
    26.             skyController.AzureSetTime(skyController.Azure_Timeline, 0.0f);
    27.         else
    28.             skyController.AzureSetTime(skyController.Azure_Timeline, startDayDuration);
    29.  
    30.         isMoving = !isMoving;
    31.     }
    32. }
    33.  
     
    Hormic likes this.
  3. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    248
    Thank you man, you are amazing!!! :-D
    Works brilliant and it really looks very beautiful now. :-D
    I can send you the downloadlink for the scene build in the next days, if you like.
    It requires an OpenVR Headset.
     
  4. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    I'm glad everything is working.

    Thanks, but this will not be necessary because I do not have a VR device.
     
    Hormic likes this.
  5. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Azure[Sky] Dynamic Skybox v4.3.9 is available! - Asset Store Link

    What's new!
    • Added a new approach to implement the transparent shaders to work with the fog scattering effect. This new approach is faster and fixes bugs and artifacts generated by the earlier approach that used a projection technique. See more details here in the post #945.

    • The alternative versions of the built-in transparent shader were rewritten to work with the new approach, now with the new approach the fog handles the ForwardAdd passes and works correctly with spot and point lights.

    • All the features are now supported again for all Unity versions starting from Unity 5.6.0.
     
  6. Zeevex

    Zeevex

    Joined:
    Jan 15, 2018
    Posts:
    15
    Hey! i've been a user of this skybox for a little while now, i love it!
    i'm wondering at the moment though, i'm using the Lightweight Render pipeline, and can't seem to get the fog working, there isn't support for it?
     
  7. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    15
    The fog scattering makes the game to stutter.

    For testing this I've created a minimal scene and everything works, but when I add the fog scattering I get this stuttering:
    - it doesn't drop fps that much and also the graphs in the profiler show almost no difference, but when moving, form time to time everything seems to stop for around 0.3secs and then runs smoothly again for several seconds until it stops again for around 0.3secs.
    When the fog scattering gets removed the stuttering is away too.

    The profiler shows a rather small gc.alloc but I would guess this could be the reason.

    This happens in editor and in build (windows 10, unity 2018.3.0f2, azure 4.3.9 (Jan 25, 2019)

    How can we get rid of this stutter?
     
  8. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    15
    I think I've found the solution to the gc.alloc that cause the stuttering.
    If someone is also suffering from this, it is the GetComponent<Camera>(); call.
    For licensing issues I do not paste the full code and if you need it, I've sent Denis the source with some additional changes.
     
  9. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Hi everyone, sorry for the absence. Again a storm left me without internet access.

    Currently, Azure does not support LWRP and HDRP. Maybe after the Scriptable Rendering Pipeline is officially released, this is implemented.


    Hi!
    I never noticed any stuttering in the tests I did, for me the fog always worked smoothly, but I confess I did not do many tests using Unity 2018.3 because that version presented many problems with me and I intend to skip straight into Unity 2019 when it is released.



    I'm glad you found a solution.
    Thanks for sending the source with the fix, I'll include it in the next update.
     
  10. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    120
    Hi

    I just got this to experiment with and I wondered if you could give me any tips on integrating it with Hydroform.

    Thanks
    Jason
     
  11. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Hi!
    I updated the first-page with instructions on how to make Azure work with Hydroform Ocean System.

    This is the result I got:
    HydroformAzure.jpg
     
    Jason210 and ftejada like this.
  12. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    433
    Does Azure have a built in event system, ideally tied to time? Something like at 6am I want an event sent out so that outside lanterns turn off for example.

    A quick scan over the API seems like I can get the time of day and then set up my own event system, but curious if it already exists before I dig into that.

    Thanks!
     
  13. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    There is no event system linked to the timeline, but there is one feature that I consider even more useful that is the Output System. The Output System allows you to create extra curves and gradients to dynamically control all sorts of things in your game according to the timeline.

    Here an old video with a small demonstration of how to use the Output System.

    There have been some API changes since the video was recorded, but the process is the same as shown in the video. The nomenclature of the methods to access the outputs has changed to:
    GetCurveOutput (int element) => returns a float that you can convert to integer if necessary.
    GetGradientOutput (int element) => returns a Color.
     
  14. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    433
    Awesome, I'll check it out. Thanks!
     
  15. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    522
    Hi,
    Looking to azure since the beginning, i'm now looking at the Lite version for some performance needs
    Could you post some pics of skies made with the lite version??
    The output system sounds great!
     
  16. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Hi!
    All screenshots shown on the Azure[Sky] Lite page on the Asset Store were made using the Lite version. In the description, you also find the download links for the demos.
     
    eaque likes this.
  17. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    522
    i forgot about the demo!!
    many thanks!
     
  18. Ttravi

    Ttravi

    Joined:
    Jan 22, 2018
    Posts:
    26
    Good morning,

    I'm trying to use Azure Sky with SpriteLights:
    https://assetstore.unity.com/packages/vfx/shaders/spritelights-46409

    But when I use the lights with the shader set on Geometry render Queue, it becomes occluded by Azure Sky Dome. It only works as intented when the lights shader is set to Transparent Queue:



    The real issue here is: I'm forced to use Geometry render Queue on these lights so I can see them at distance. Using Transparent render Queue make the "resize at distance" logic from SpriteLights scrips useless.

    What part of the code or the shader of Azure Sky can I change to fix this?
     
  19. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Hi!
    I'm not familiar with SpriteLights, but this issue seems to be related to SpriteLights and not to Azure[Sky] because it is possible to reproduce the same problem if you use the Unity's Default-Skybox.

    The sky material is set in the background queue, so the sky will always be rendered behind the geometries, you can confirm this by selecting the sky material and see that the Render Queue value of the sky material is less than the SpriteLights material.

    This is strange and I do not know why the SpriteLights material is occluded by the sky, but this seems to occur only with skybox materials no matter which one you use.

    What you can do is change the Shader Mode to "Vertex Shader - Skydome" instead of "Pixel Shader - Skybox" in the sky controller's Options tab. That way the sky will be rendered as a skydome and not as a skybox material.

    Be sure to select the skydome inside the prefab to change the scale so that the dome covers the whole scene, but do not set a scale larger than the camera far clipping plane, otherwise the skydome mesh will not be rendered.

    This fixed the issue for me.
     
  20. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    120
    Thank you!
     
  21. tmeador

    tmeador

    Joined:
    Jan 10, 2019
    Posts:
    1
    Hello,
    I'm trying to use Azure Sky in a 2d side scrolling game. Is there any way to adjust the horizon point of the background skybox? Currently the horizon lands at the mid point of the scene.
    thanks!
     
  22. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Hi!
    Azure[Sky] was developed to work on 3D games so it will not work properly with hortographic cameras.

    You can try to change in the Options tab of the sky controller the Shader Mode to "Vertex Shader - Skydome" and also on the same tab disable the "Follow Active Main Camera". That way a dome is used around the scene instead of the skybox material, and you can then change the position of the skydome inside the sky controller prefab to change the horizon line position.

    Another option is to use two cameras, the first camera with projection mode set to Perspective to render only the sky and the second camera with the projection mode set as Orthographic to render the rest of the scene. Then you can simply rotate the first camera so that it renders the area of the sky you want or simply change the position of the dome as explained above.

    First camera settings:
    FirstCam.jpg

    Second camera settings:
    SecondCam.jpg SecondCam2.jpg

    Skydome layer setting:
    SkydomeLayer.jpg
     
  23. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    433
    Does Azure support cloud shadows or adjusting the light if a cloud goes in front of the sun or moon?

    I searched through the thread and it looks like someone asked back in 2016, but I don't think it was ever directly replied to or brought up again.
     
  24. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    439
    Azure does not support cloud shadows, but you can try using a light cookie.