Search Unity

Time of Day - Dynamic Sky Dome

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

  1. shanemburger

    shanemburger

    Joined:
    Oct 15, 2014
    Posts:
    3
  2. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    I haven't used the 4.6 UI, but it looks to me like it only lists default Unity methods - which means you'll probably have to write it yourself.
     
  3. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Connect the slider to your own script, and change the TOD values there.
     
  4. WoodsBagot

    WoodsBagot

    Joined:
    Mar 6, 2014
    Posts:
    8
    This is what did the trick - I added this script to the slider component, and then referenced it...

    using UnityEngine;
    using System.Collections;

    public class TOD_update : MonoBehaviour {

    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {

    }
    public void ChangeSlider (float sliderValue) {
    TOD_Sky.Instance.Cycle.Hour = sliderValue;
    }
     
  5. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    2.3.0 is out!
     
  6. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    It´s great!

    A little example:



    Webplayer
     
  7. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    708
    Thanks for the web player example. My only concern is it is pitch black in the morning even when the moon is up. Is this the plugin's default behaviour or just the way it has been set up in the web player?
     
  8. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Ambient light can be configured in a way that it's always enabled, so that you never have a completely black scene. The directional light will always have a "completely disabled" phase when it switches from sun to moon.
     
  9. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    708
    Ok I guess I should just buy the plugin and play and discover for myself! ;-)
     
  10. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    I would like to thank you very much for being ahead of the game and making this work well with Unity 5. Now the beta for unity 5 for pre-order customers and subscribers is out, I look forward to giving it a spin today. I've purchased quite a few sky-related assets in the past but you won my custom by being on the ball!
     
  11. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Looking forward to feedback regarding Unity 5! We've been using Time of Day with Unity 5 for a few months now I think, so it should be quite battle tested. I'm planning to release 2.3.1 soonish with some minor tweaks and fixes, so if you find any issues please report them as quickly as possible so that I can include them in that first 2.3 patch release.
     
    elbows and jcarpay like this.
  12. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    673
    I just upgraded to the most recent release, and it's giving me a number of errors in SkyTestGUI.cs, all variants of TOD_Weather does not contain a definition for CloudType and WeatherType. Did I somehow mess up the update process?

    Edited to add that I fixed the issue by fully uninstalling TOD and then re-downloading it fresh, leaving the post in case anyone else trips over the same thing. ^^
     
    Last edited: Oct 28, 2014
  13. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    The "Demo" folder is deprecated - I recommend deleting the Time of Day folder and reimporting it afterwards since a couple of file names changed as well, which won't get updated if you import the new version over the old one.

    Here's a version of SkyTestGUI that works with 2.3.0 for those who don't write code and were using it in their scenes. However, I recommend using the new Unity UI instead of this legacy one.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class SkyTestGUI : MonoBehaviour
    4. {
    5.     public TOD_Sky sky;
    6.     public bool fog, godRays, progressTime;
    7.  
    8.     private Rect rect = new Rect(-3, -3, 200, 450+6);
    9.     private const float label_width = 100;
    10.  
    11.     private string[] cloudTypes = {
    12.         TOD_CloudType.None.ToString(),
    13.         TOD_CloudType.Few.ToString(),
    14.         TOD_CloudType.Scattered.ToString(),
    15.         TOD_CloudType.Broken.ToString(),
    16.         TOD_CloudType.Overcast.ToString()
    17.     };
    18.  
    19.     private string[] weatherTypes = {
    20.         TOD_WeatherType.Clear.ToString(),
    21.         TOD_WeatherType.Storm.ToString(),
    22.         TOD_WeatherType.Dust.ToString(),
    23.         TOD_WeatherType.Fog.ToString()
    24.     };
    25.  
    26.     protected void OnEnable()
    27.     {
    28.         if (!sky) sky = TOD_Sky.Instance;
    29.     }
    30.  
    31.     protected void OnGUI()
    32.     {
    33.         GUILayout.BeginArea(rect, "", "Box");
    34.         GUILayout.BeginVertical();
    35.         GUILayout.FlexibleSpace();
    36.  
    37.         GUILayout.BeginHorizontal();
    38.         GUILayout.Label("Time of Day", GUILayout.Width(label_width));
    39.         sky.Cycle.Hour = GUILayout.HorizontalSlider(sky.Cycle.Hour, 0, 24);
    40.         GUILayout.EndHorizontal();
    41.  
    42.         GUILayout.BeginHorizontal();
    43.         GUILayout.Label("Moon Phase", GUILayout.Width(label_width));
    44.         sky.Moon.Phase = GUILayout.HorizontalSlider(sky.Moon.Phase, -1, 1);
    45.         GUILayout.EndHorizontal();
    46.  
    47.         GUILayout.BeginHorizontal();
    48.         GUILayout.Label("Sky Contrast", GUILayout.Width(label_width));
    49.         sky.Atmosphere.Contrast = GUILayout.HorizontalSlider(sky.Atmosphere.Contrast, 0.5f, 1.5f);
    50.         GUILayout.EndHorizontal();
    51.  
    52.         GUILayout.FlexibleSpace();
    53.  
    54.         if (progressTime)
    55.         {
    56.             GUILayout.BeginHorizontal();
    57.             sky.Components.Time.enabled = GUILayout.Toggle(sky.Components.Time.enabled, " Progress Time");
    58.             GUILayout.EndHorizontal();
    59.         }
    60.  
    61.         if (godRays)
    62.         {
    63.             GUILayout.BeginHorizontal();
    64.             var rays = GetComponent<TOD_Rays>();
    65.             rays.enabled = GUILayout.Toggle(rays.enabled, " God Rays");
    66.             GUILayout.EndHorizontal();
    67.         }
    68.  
    69.         if (fog)
    70.         {
    71.             GUILayout.BeginHorizontal();
    72.             RenderSettings.fog = GUILayout.Toggle(RenderSettings.fog, " Enable Fog");
    73.             GUILayout.EndHorizontal();
    74.         }
    75.  
    76.         GUILayout.FlexibleSpace();
    77.  
    78.         GUILayout.BeginHorizontal();
    79.         GUILayout.FlexibleSpace();
    80.         GUILayout.Label("CLOUDS");
    81.         GUILayout.FlexibleSpace();
    82.         GUILayout.EndHorizontal();
    83.  
    84.         int cloudType = GUILayout.SelectionGrid((int)sky.Components.Weather.Clouds - 1, cloudTypes, 1) + 1;
    85.         sky.Components.Weather.Clouds = (TOD_CloudType)cloudType;
    86.  
    87.         GUILayout.FlexibleSpace();
    88.  
    89.         GUILayout.BeginHorizontal();
    90.         GUILayout.FlexibleSpace();
    91.         GUILayout.Label("WEATHER");
    92.         GUILayout.FlexibleSpace();
    93.         GUILayout.EndHorizontal();
    94.  
    95.         int weatherType = GUILayout.SelectionGrid((int)sky.Components.Weather.Weather - 1, weatherTypes, 1) + 1;
    96.         sky.Components.Weather.Weather = (TOD_WeatherType)weatherType;
    97.  
    98.         GUILayout.FlexibleSpace();
    99.         GUILayout.EndVertical();
    100.         GUILayout.EndArea();
    101.     }
    102. }
    103.  
     
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    Until now I work with both Skyshop and TimeOfDay.
    My problem is that Skyshop does not operate on dynamically generated skyboxes:
    This means that the nice skies generated with TimeOfDay can´t be used as skyshop-compatible skyboxes.

    Will it be possible to pass the sky generated with this TimeOfDay-Plugin over to the new Unity5 Skybox-Lighting system in realtime?
     
  15. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
  16. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    Cool, some more infos?
     
  17. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    First of all, if you haven't watched this overview of PBR in Unity 5 already I recommend doing so before using the new Shaders:


    Time of Day can update both the per-scene ambient light and the per-scene reflection probe at runtime. Ambient light can be flat, trilight and spherical harmonics. The reflection probe is always a cubemap. You can adjust the resolution, update interval and brightness of both ambient light and the reflection cubemap. Both contain approximations of the atmosphere and lerp to the ambient light color that is set in Time of Day towards the bottom half (you can look at this as the ground color since Time of Day cannot know what color to use for the ground). You can choose to include or exclude directional light glow in the ambient light and the reflection cubemap.

    The second option Unity 5 offers natively is to place reflection probes that bake the world around them and are then automatically used in the new PBR shader - which is essentially exactly what Skyshop does. However, just as Skyshop they have to be baked and cannot be dynamic as of the current beta.

    You can combine the two by using the dynamic Time of Day ambient light and reflection as fallback for open parts of your world and have baked reflection probes for houses etc where the sky doesn't affect ambient light and reflections.

    I hope to get some detailed docs for this up over the next couple of days, but for now just feel free to ask if you have any questions.
     
  18. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    Thank you, this sounds promising to me.
    Looking forward to read your detailed docs soon.
    Can´t wait to check it all out in Unity5.
     
  19. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,022
    Hi, i'm just playing around with Time of Day in Unity 5 beta. Since GI is enabled with a basic skybox by default, do we need to disable this before adding ToD or does ToD adjust those values at runtime? Just trying to set up the most efficient scene.

    Thanks
     
  20. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Those values will be adjusted by Time of Day both in edit mode and at runtime if required. You shouldn't have to do adjust anything manually.
     
  21. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    Will try to get through the same thing soon.
    If its neccessary perhaps André could write a quick tutorial including a demoscene on this since its a fundamental setup process.
     
  22. MACINA_df

    MACINA_df

    Joined:
    Aug 29, 2012
    Posts:
    3
    Hey, i just bought this very nice asset a few days ago as i read in the changelog that it is already prepared for Unity 5 usage. As it doesn't seem to affect the skybox in my current setup (just imported the package and dragged the prefab into the scene) would you care to elaborate how to set it up in Unity 5 so that it affects the indirect skybox light?

    Thanks!
     
  23. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Check out the "Ambient" and "Reflection" parameter sections on the prefab:



    "Spherical" means it'll use spherical harmonics (i.e. what the skybox you mentioned is being converted to internally) for the ambient light and "Cubemap" means it'll use a cubemap for the reflections.

    Furthermore you can adjust ambient and reflection multipliers for day and night in the "Day" and "Night" parameter sections on the prefab to tweak the exposure / intensity of both ambient light and reflections.
     
  24. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    The Sydome/Light-Object with lensflares enabled is not congruent with the Skydome/Sun-object in my scene.
    To avoid this I use a script that sets the position of the Skydome to the position of the camera.

    Now I see that the shadows are changing when my camera is moving:
    The angle of the sunlight is changing when the skydome is being moved (not rotated): Bug?
     
  25. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    You should use TOD_Camera for this, see the first steps in the docs: http://modmonkeys.net/dat/doc/timeofday/#start

    Thanks for reporting - part of this is in fact a bug, part of it is a feature. The reason the light changes in the first place is to keep the sky dome horizon line at the zero level (TOD_Sky.World.ZeroLevel) of your scene.



    Naturally a sky dome has to be centered around the camera and be close to the far clipping plane to get the correct result - which TOD_Camera should be used for. However, the sky dome horizon should visually always be where your world meets your far plane. This means that at sunset the light should be exactly at the middle of the sky dome in the left situation but a lot lower than that in the right one.

    So far it's working as intended, but while the light position has to be adjusted, its direction certainly shouldn't change for most scenes (with the exception of possibly flight simulators) from the left to the right situation to avoid such change in object shading as you're experiencing. I'll address this in 2.3.1 by making the direction adjustment optional. As a workaround you can disable this functionality completely by setting World.ZeroLevel to the camera height in your script. I'll also add a checkbox to do this automatically in TOD_Camera starting with 2.3.1 in case people don't want this behaviour at all (i.e. no horizon line adjustment).

    Thanks again for reporting - let me know if the workaround works for you. I plan to submit 2.3.1 next weekend. As always, I can send out prerelease versions of it to those who require a fix before it's on the Asset Store. To receive one, just write me an email with your Asset Store invoice #.
     
    hopeful likes this.
  26. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    Is there a way to refresh the ambient light probe immediatelly (e.g. after setting new values for Hour, Day, ...) other than setting the UpdateInterval to 0 for 1 frame?
     
  27. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    You could call TOD_Sky.RenderToSH3(...) yourself, but you're right - there should be an easier way. I'll add something to 2.3.1 that does this with a simple method call without any parameters. Until then, you can do this:

    Code (CSharp):
    1. var sky = TOD_Sky.Instance;
    2. var exposure = Mathf.Lerp(sky.Night.AmbientMultiplier, sky.Day.AmbientMultiplier, sky.LerpValue);
    3. RenderSettings.ambientProbe = sky.RenderToSH3(sky.Ambient.Resolution, exposure, sky.Ambient.Directional);
    Thanks for the feedback, I really appreciate it.
     
  28. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    seems, I'm missing something... (I've installed Time of Day v2.3.0)

    error CS1061: Type `TOD_Sky' does not contain a definition for `RenderToSH3' and no extension method `RenderToSH3' of type `TOD_Sky' could be found (are you missing a using directive or an assembly reference?)

    error CS0117: `UnityEngine.RenderSettings' does not contain a definition for `ambientProbe'
     
  29. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Are you sure you're running Unity 5? From the Unity 5 docs:



    RenderToSH3 is also enabled or disabled depending on whether or not you're running Unity 5. The reason I was assuming you are on 5.0 is because you wrote "ambient light probe" and Unity 4 only supports flat ambient light, no probes.

    If you're not using Unity 5 and therefore use the flat ambient light mode, you can simply do the following:

    Code (CSharp):
    1. var sky = TOD_Sky.Instance;
    2. var exposure = Mathf.Lerp(sky.Night.AmbientMultiplier, sky.Day.AmbientMultiplier, sky.LerpValue);
    3. RenderSettings.ambientLight = TOD_Util.ExpRGB(sky.AmbientColor, exposure);
    But in that case I recommend simply leaving the ambient update interval at 0 as updating the flat ambient light is so cheap that it shouldn't really matter.
     
  30. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    ah, ok thanks! (I'm running Unity 4)
     
  31. MACINA_df

    MACINA_df

    Joined:
    Aug 29, 2012
    Posts:
    3
    Sorry for the late Reply, but i'm currently in heavy crunchtime to get a product shipped on time. My actual Problem was not stated very well in my first post. Environment lighting is working correctly, but my reflection Probes are picking up the skycolor of the default skybox, which looks wrong with a dynamic sky. To fix this i'd need something to plug into the Skybox material slot in the scene render settings.

    Best Regards!
     
  32. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Reflection probes are statically baked - they'll never react to a dynamic sky unless refreshed at runtime (which as far as I know is not supported as of the current beta, correct me if I'm wrong). This is why you can only use the reflection probes inside buildings (or outdoor if you don't use a dynamic day / night cycle). For outdoor scenes with a dynamic day / night cycle you have to fall back to the sky-only reflection created by Time of Day - which Unity does automatically when there's no probe nearby.
     
  33. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    When running Time of Day on an iOS device, I notice a small lag in my app on the first day to night transition (when Cycle.Hour is around 20, with Day=1, Month=7, Year=2014, Zero Level=0, Latitude=0, Longitude=0, UTC=0). Is there something special going on (texture loading?). Is there a way to prevent it? (load, create, init everything before progressing time)

    Time of Day v2.3.0
    Unity 4.5.5f1
     
  34. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    There's nothing too special going on in code other than enabling the moon object and switching the light source direction. I suspect Unity loads the moon mesh, texture and shader around that time. I'll investigate if it's possible to preload everything without doing hacky stuff like setting the time to noon / midnight for a frame at scene startup. As a first try you can call Shader.WarmupAllShaders() at scene load and see if that fixes or at least lessens the hiccup.
     
  35. Andyzano

    Andyzano

    Joined:
    May 20, 2014
    Posts:
    39
    Hi,

    I don't own Time of Day but I would like to know a thing that could lead me to buy it. I took a peek at the documentation that's available here http://modmonkeys.net/dat/doc/timeofday and I noticed that it seems to be possible to set a custom clock with a custom time (like, a day = 1 hr) which is very cool. My game (development is starting just now) is heavily based on two things:
    - realistic weather as the day goes on (and this should be good)
    - events based on the hour. I'm not too good at scripting though so I would like to know how easy\if it possible to have events based on the time. A realistic applicable example would be that when the clock hits for example 7 pm, another scene is loaded.
    Is this possible\easy to do\code? Sorry for the long post :)
     
  36. Evil_Echo

    Evil_Echo

    Joined:
    Sep 30, 2011
    Posts:
    48
    Andyzano,

    Loading another scene is entirely up to you, but ToD does not get in the way of such things. Should not be difficult.

    My Zulu simulation library project uses it's own external clock ( aka Zulu time :) ) to drive ToD's sun across the sky. André has done quite a bit to make my work with missions on planets other than earth easy for the more obvious effects and mostly possible for other things. His weather effects are limited, but again easy to work with. For things like rain or snow you will need to go outside of ToD.

    In summary - yes, you can accomplish your goal with some effort.
     
  37. Andyzano

    Andyzano

    Joined:
    May 20, 2014
    Posts:
    39
    Hi,

    thanks. The problem is that to me, as a beginner in scripting, it seemed easier to use ToD pre-existant custom time (maybe in some way I could "catch" the numbers that I see in the editor and show them in text meshes in a clock too, it'd be cool) than doing the opposite. For opposite I mean, like you said, to make ToD's sun dependent on external time.

    Here's an example (pardon the horrible code which probably is wrong :/ ) at what I'm looking at, to explain myself better (I'm making up names of most of the ToD components obviously here as I don't know them, just took a peek at the documents):

    var eventHour : int;
    var eventMinutes : int;
    function Start ()
    {
    timeofday = GameObject.Find("TimeofDay");
    }
    function Update ()
    {
    if (TimeofDay.GetComponent(TOD_Time).TOD_Sky.Cycle.Hour = eventHour)
    if (TimeofDay.GetComponent(TOD_Time).TOD_Sky.Cycle.Minutes= eventMinutes)
    {
    Application.LoadLevel bla bla \ or script of an "event"
    }

    is this possible?
     
  38. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    I always wanted to add a nice event subscription system at some point, but it's not in there as of now. What you basically would have to do is store the previous TOD_Sky.Instance.Cycle.DateTime and the current value, calculate a time span and check if your time is within that time span. If you have no scripting knowledge whatsoever you probably won't manage to do that. That being said, you won't be able to script the events themselves without knowing how to write basic scripts - so maybe you should start with some Unity programming tutorials or look for a programmer to help you out.
     
  39. Andyzano

    Andyzano

    Joined:
    May 20, 2014
    Posts:
    39
    hmm, understood, thanks, too bad. As for the events, I already have them prepared, they're all simple stuff like "load this scene" "activate this gameobject", etc. so that wasn't the problem. But yeah, the rest seems a bit too hard right now.
     
  40. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,162
    In my little Webplayer above there´s a slider that lets the sun move.
    My be the programmer of the plugin can implement such a slider in the Editor (todSky.Cycle) for easier manipulating the time of day. Slider at zero would be 0.00 and slider at one would be 23.59 o´clock.
     
  41. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    I usually use the default Unity inspector variable slider for this. You can access it by clicking on the name of the property (e.g. "Hour" in the category "Cycle" of TOD_Sky) and dragging your mouse left or right while holding down the mouse button.
     
  42. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    Hi. I saw this question asked earlier but didn't see an answer: Does this kit support adding more than 1 sun? I'm wondering if it could be used for a sci-fi game in that respect, possibly along with something like Space for Unity or Space Graphics Toolkit.
     
  43. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    @Andyzano you can use Playmaker to get/set public variables from any script using the Get Property action. Then make conditions based on those variables.
     
  44. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    Time of Day only updates the location of one sun object (based on the orbital constants of earth around sol) - so if you add a second sun you'd have to calculate its position yourself. For a simple setup it might be enough to position the second sun realtive to the main sun via some offset. I haven't fully figured out yet whether or not I want to fully expose all orbital parameters and allow people to add as many suns as they like to be directly managed by Time of Day. It would be pretty cool, but it would also add a lot of clutter to the project.

    I cannot speak for the two packages you mentioned as I don't own them and have never used them.
     
  45. Evil_Echo

    Evil_Echo

    Joined:
    Sep 30, 2011
    Posts:
    48
    Understand about the concerns over multiple suns ( and moons !!! ). I do think this could be integrated into ToD without a fatal amount of complication, although it initially may require some adjustments to code organization

    Andre, I have not forgotten about your interest in my atmospheric calculations to predict cloud cover ( a form of climate modeling ). The work was spread out over several classes - not readily sharable. I've been restructuring in order to make that work available for you, and to unify some critical databases involved.
     
  46. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    Shader.WarmupAllShaders() didn't lessen the hiccup.
    Have you found a way to preload the resources?
     
  47. Andyzano

    Andyzano

    Joined:
    May 20, 2014
    Posts:
    39
    Thank you, hamyshank. I do not own Playmaker unfortunately, but this could be a reason to buy it. I'll have to carefully look at this.
     
  48. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,022
    I'm using Time of Day with Unity 5 and Speedtree trees. I've noticed the tree's are too bright. Should i lower the brightness & ambience of Time of Day or adjust the tree materials or doesn't it really matter? Thanks
     
  49. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    680
    I haven't found any built-in ways to preload disabled mesh renderers. I think we have to narrow it down manually. In TOD_Sky.cs line 360 you should see the following:

    Code (CSharp):
    1. var moonEnabled  = (Components.MoonTransform.localPosition.y > -(HorizonOffset + moon_d));
    Go ahead and replace it with this:

    Code (CSharp):
    1. var moonEnabled  = true;
    And report back if that solves your problem. If it does, I could write something up to always keep the moon object enabled at scene start and disable it starting with the second frame.

    It doesn't really matter and is kind of unrelated to Time of Day but rather a decision that depends on your entire project. If the rest of your scene looks as you want it to look, adjust the trees. If everything looks too bright, adjust the lighting. It's probable that ambient light is the cause of overly bright lighting (if the shadows are too bright as well), in which case I would recommend reducing Day.AmbientMultiplier.
     
  50. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    230

    Wanted to chime in with a small experience of mine; a bit easy thing but I noticed this after sometime.

    A new scene in Unity 5 comes with a default directional light and the TOD prefab has its own directional light and if you forget that just like I did it while making quick tests, you get an unintentional bright scene :)
     
unityunity