Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Time of Day - Dynamic Sky Dome

Discussion in 'Assets and Asset Store' started by andererandre, Mar 4, 2013.

  1. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    what are the official sky solutions provided by unity? As far as I know, there is none.
     
  2. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    From what I understand the Physically Based Sky is intended to be the future. They are also working on Volumetric Clouds and Cloud Layers.
     
  3. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    but that's for high definition, not for mobile which was the main use of these packages
     
  4. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Thank you, Andre. If you have moved on perhaps this is the best thing to do. Why did Unity asked you to make changes? Did they ask you to support the new render pipelines, perhaps?
     
  5. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Given that this might be the sunset of this asset, I'd like to publicly thank @PanicEnsues for years of support of his fellow users, including me, in this forum. Your answers were always fast, well informed and detailed. Thank you for disinterested support!
     
  6. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    189
    You're quite welcome, glad I was able to pay forward some of the great Unity Forums help I've received over the years!

    And thanks to @andererandre for making this plugin; it saved me a ton of work on my last game and was quite easy to work with.
     
    Salvador-Romero likes this.
  7. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    189
    Knowing what the actual error is (and the code that caused it) would be kind of essential to helping with any debugging.

    This function will convert a float hour to a 24-hour time string:
    Code (CSharp):
    1.     public static string HoursToTimeString(float hour)
    2.     {
    3.         var ts = System.TimeSpan.FromHours(hour);
    4.         string val = ts.Hours.ToString("00") +
    5.             ":" + ts.Minutes.ToString("00") +
    6.             ":" + ts.Seconds.ToString("00");
    7.         return val;
    8.     }
     
    rusvenlee likes this.
  8. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Add this script as a component to the UIText object you are using to display hours or minutes:

    Code (CSharp):
    1.     public class CurrentTimeInText : MonoBehaviour
    2.     {
    3.         public enum TimeSection { Hour, Minute};
    4.  
    5.         public TimeSection section; //This is to select if you want the text to show hours or minutes from the editor
    6.         private TOD_Sky TodManager;
    7.         private Text Text;
    8.  
    9.         void Awake()
    10.         {
    11.             var tod = GameObject.FindGameObjectWithTag("TimeOfDay");
    12.             TodManager = tod.GetComponent<TOD_Sky>();
    13.             Text = GetComponent<Text>();
    14.         }
    15.  
    16.         void Update()
    17.         {
    18.             Text.text = section == TimeSection.Hour ? TodManager.Cycle.DateTime.Hour.ToString("00") : TodManager.Cycle.DateTime.Minute.ToString("00");
    19.         }
    20.     }
    TOD example.png

    I use separate UIText objects for hours and minutes so I can layout them easier, but you may not need it.

    You may need to add the tag "TimeOfDay" to the Time of Day object.

    Cheers.
     
    rusvenlee likes this.
  9. zak666

    zak666

    Joined:
    Mar 3, 2014
    Posts:
    40
    Dam its gone, looks really good really wanted to buy this RIP
     
  10. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    There is an error in "Atmosphere.shader". The bottom vertex of that sphere has its normal pointing straight up (0, 1, 0), and the shader is not handling that data correctly.

    Easy solutions (either will work):
    1) in Sky.fbx import tab enable mesh compression;
    2) import Sky.fbx into any 3D editing software and slightly move that bottom vertex so as to change its normal;

    Or you can edit Atmosphere.shader and fix the error, of course.

    Just leaving this here in case somebody else will be googling for this fix a few years later.
     
  11. alvaro95bs

    alvaro95bs

    Joined:
    Oct 3, 2018
    Posts:
    1
    Hi, how can I download? its from Unity 2018, thanks!
     
  12. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    47
    Hey. I understand that this asset is a decade old, that the creator has deprecated it because he does not have the time to support it, that other solutions exist and that those that have been helping in this thread have even abandoned it, with the last response going unanswered for months.

    I would still like to take a shot with this question: Using built in renderer, forward rendering path and the CREST WATER system, the "Camera Atmospheric Scattering" is not taking into account the ocean and the "fog" of the atmospheric scattering is not being applied over any visible ocean. Does anyone have any idea as to a fix for this, be it script execution orders, shader modification, or whatnot?

    Thanks
     
  13. buger_bugger

    buger_bugger

    Joined:
    Apr 25, 2024
    Posts:
    1
    I need this for making modules, but now I can't get/download unity, which shows that the resource has been removed. What should I do?
     
  14. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,717
    Not sure exactly what you need, but there are other time of day / atmospherics type assets in the store. Research them carefully to make sure you're getting the features you need.
     
  15. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,691
    Yes, unfortunately this asset was discontinued a long time ago.
    What do you mean by modules? If you just need an asset that automatically sets the appropriate light for the time of day based on location and date, then SunLight - location based Time of Day, for example, would be a robust solution with no unnecessary bells and whistles that works with Unity's built-in sky. The basic function is to adjust the rotation and color of the directional light used for the sky so that it is perfectly compatible with the standards.
     
  16. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    184
    Does anyone have any ideas of how to get the moon phase out of TOD?
     
  17. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,273
    Get it out? Why?
     
  18. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    189
    I don't see a phase value anywhere in the TOD code, I don't think it exists.

    But TOD's star/moon cycles are (allegedly) real-world accurate, so a calculated moon phase for any given date SHOULD match up with the visuals. In theory. :)

    E.g.: https://khalidabuhakmeh.com/calculate-moon-phase-with-csharp
     
  19. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,273
    I've been using TOD for years, it is accurate. I think the moon phase is just calculated by the position of the moon in relation to the sun as the moon is a 3d object and not just an image