Search Unity

Time of Day - Dynamic Sky Dome

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

  1. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    You can, but note that TOD_Sky.SunriseTime and TOD_Sky.SunsetTime don't influence the visuals of the sky you see at all - they are just values that are calculated from the current sun altitude - i.e. sunrise time is when the sun reaches an altitude greater than -6 in the morning and sunset time is when the sun reaches an altitude of -6 in the evening. The only things those values affect are the TOD_Time.OnSunrise and TOD_Time.OnSunset events, which in turn don't do anything unless you actually subscribed methods to them. I don't think that's the problem you're having, is it?

    I compared the sun altitude of Time of Day (TOD_Sky.SunAltitude) to the values you posted for London (on 2015-07-17) and they do match for sunset, sunrise, noon and midnight (with UTC+1). This confirms my suspicion that the sun position is calculated correctly. That being said, the visuals of the sky - i.e. the light scattering a given sun altitude results in - can still be different than those in London of course, which I cannot confirm without seeing the real deal. This could be caused by the atmospheric parameters not matching those in London or an inaccurate or faulty calculation somewhere. It's difficult for me to check that without having comparison shots. I might be able to get some high quality photographs for various times around sunset and sunrise where I live, but that's quite a bit further south than London. There's of course also the option for me to simply add an artistic scattering multiplier for sun altitudes below 0, which would allow you to artificially darken the sky sooner or later.
     
  2. poinyentsteve

    poinyentsteve

    Joined:
    Jul 8, 2015
    Posts:
    10
    Thanks for your reply and for your patience with my rudimentary programming skills. I am triggering BigBen's tower, clock face and street lights on and off using TOD_Sky.IsNight and TOD_Sky.IsDay, which I believe are themselves triggered by .OnSunset and .OnSunrise. And those are triggering at the 3am time.

    I have some friends in London, but I am afraid they are not quite good enough friends for me to ask if they will take a picture for us at 3am so they can aid our efforts. :)

    I was thinking just for expediency's sake I could work a hack and put in some sort of manual offset by adding 2 hours to TOD_Sky.SunriseTime:

    SunriseTime = (24f + ((ut_deg - lha_deg) / 15f) % 24f) % 24f;

    But having played with this, I haven't been able to make it work. Would this approach work and if so how would you suggest tweaking?

    Many thanks, Steve
     
  3. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    IsDay and IsNight do not depend on SunriseTime and SunsetTime, but instead depend on when the main light source switches from the Sun to the Moon and vice versa. If you want to switch lights on and off depending on the time I recommend looking at the TOD_LightAtTime example script, or to simply check TOD_Sky.Instance.Cycle.Hour (this would probably be what street lights in London are actually using, unless they have ones with light sensors) or TOD_Sky.Instance.LerpValue (smoothly fades from 0 at night to 1 at day, so you can use that to switch lights on or off based on the overall scene brightness rather than the current time, which would be the equivalent to street lights with light sensors).
     
    hopeful likes this.
  4. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Hi, TOD had some problem with Unity 5.2B4 please check what's the problem, I'm stuck
     
  5. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Weird, in unity 5.2 b4 it doesn't allow me to change my ambient light from TOD! for example I pick red color for my ambient light but after backing light unity force it to use default ambient light! can you check that please?
     
  6. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Ok after much research just purchased but having some difficulty getting results I want. For one thing, why is it not possible for the lighting in the scene view to closely match the game view? See attached I'm using Forward rendering-Linear color space and have Sun, Atmosphere, Clear, Clouds and Light enabled. I didn't notice any default scenes in the install package with default settings which might have helped. I'm primarily interested in light scattering, ground fog, volumetric effects. Perhaps this package isn't suited for my needs? Any feedback most welcome! game_scene_view.jpg
     
  7. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings plzdiekthxbye, I am having a major performance issue I wanted to mention here and see if anyone else was having it and if there was something to do about it.

    The issue is once I have entered a scene with Time of Day in it, ran it, stopped it and edited and saved it, from that point on no matter what other scene I run, the loss of FPS that TOD causes remains as if resources are locked up. Kept having this happen in my project where I would load into my main play scene with TOD for the first time upon startup and I would have 100+ fps. Stop scene, go make some changes, save and change back to my loading scene. Hit play and when the scene with TOD loads in boom, down to 50+ FPS from 100+ fps on the first load in. My FPS will not restore until I restart Unity, then that scene with TOD runs at 100+fps the first time I run it.

    So I also made a clean test. Blank 1 scene with camera and cube, no Light baking (set to real time) and an FPS meter. Hit play and 255+ FPS. Load in Blank 2 scene with TOD in it. This has camera and TOD skydome and no Light baking, same setup as Blank 1 scene. Run the scene 160 fps. Now I load up Blank 1 scene that has no TOD in it, hit play and instead of 255+ fps I get 150 fps. Restart Unity, run Blank 1 scene 255fps. Same result if I now run Blank 2 scene with TOD it reduces FPS by about 100 and then every other scene I run in Unity also has reduced performance until I restart Unity. The other two major shader packs in the test, though not being used just in the scenes, are Alloy and RTP.

    Let me know your thoughts, I have turned TOD off until we can solve why this is happening. Thanks!
     
    Last edited: Jul 28, 2015
  8. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Are you talking about the baked GI feature? If so, Unity's baked GI ignores ambient light in the bake and instead uses the skybox material and objects that are nearby. Unity confirmed that this is "working as intended" and probably won't change with future updates, so there's nothing I can do from my end.

    I replied to your email, but I'll post the answers to the questions you reposted in here as well.

    Unity does not support image effects on the scene camera. While there are packages on the Asset Store that do this, it's not something that is officially supported by Unity, and therefore the scene will always look somewhat different to the game view as soon as you use any image effects (like tonemapping or the ones that come with Time of Day) in your project.

    The screenshot you posted appears to demonstrate a different issue though - are you talking about the difference in the reflection probe bake? I believe this is caused by the fact that the editor doesn't refresh the default scene reflection probe unless the light source position changes. Can you try changing the Cycle.Hour inspector variable and see if that triggers a reflection probe refresh in edit mode and makes it look more like the left screenshot?

    For what you called "light scattering / ground fog / volumetric effects", see the TOD_Scattering image effect as described here: http://modmonkeys.net/dat/doc/timeofday/#effects

    Can you completely disable GI in the "lighting" window (uncheck both "Precomputed Realtime GI" and "Baked GI") and do the test again? Time of Day does not transfer anything between scenes, so it would seem very unlikely that it could cause this issue unless Unity is doing something in the background. If completely disabling GI doesn't fix the issue, can you send me the clean test project?
     
    Tethys likes this.
  9. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks for the reply. I tried your suggestion and it did not make a difference. I also just made a new Unity project. Imported TOD and one FPS meter script. Re-created the 2 scenes mentioned above. Blank 1 scene, 150-255 FPS (if you select lighting tab for some reason FPS goes up heh). Blank 2 scene with TOD, 60 fps. I then load Blank 1 scene and now 60FPS until I restart Unity and then I have high FPS again. I will Private Message you the link to the clean project (TOD Only), thanks!
     
  10. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    So in the unity lighting windows there is a parameter to increase backed ambient intensity to 8 but TOD doesn't allow it to increase more than 1. Because of that using backed ambient in unity 5.2 is weak, dark and useless.

    I'm in a hurry, please help
    Is there any easy way I can solve that bug?

     
    Last edited: Jul 30, 2015
  11. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hello,
    just wanted to say thanks for your product and create at least one post without something needing :)

    Here is a video from my project Virtual-O (virtual orienteering simulator), 24 hours using ToD in practice:


    Thanks!
    Peter
     
    Last edited: Jul 31, 2015
    Olander, hopeful and Whippets like this.
  12. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I tested your project but cannot reproduce the issue - I get 250FPS in both scenes, not matter which one I open first. To further debug the issue, open the Unity profiler (Window -> Profiler) and check what exactly is eating away at your frame time. Also, which Unity version are you using and can you send me some hardware info via PM?

    Thanks for the details, this indeed seems to have changed in 5.2, I'll make sure to fix it in the next Time of Day update. Until then you can manually fix it by opening TOD_Parameters.cs, searching for "AmbientMultiplier" (should find 2 occurences) and removing the "[Range(0f, 1f)]" attribute from both of those occurences. Alternatively you can change it to "[Range(0f, 8f)]", which will keep the slider but simply increase its max value.

    Nice to hear you like it! Looks like an interesting project.
     
    ksam2 likes this.
  13. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Ok, thanks for the reply will do with those specs! I have noticed also in my main play scene that is an outdoor voxel terrain scene, with bushes and grass and trees and other details all running I get 80+ fps. I turn on TOD and it jumps down to 30-35fps :(
     
  14. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    @Tethys @plzdiekthxbye This does not happen with me either. I am a very solid 120fps Dx11 with Tonemapping Deluxe, Bloom, Distance, and few other Image Effects that turn on and off. In Cities and Towns I am hitting 45fps but that has nothing to do with Time of Day. Lastly I am never able to hit 250fps like stated. I am v5.1.1 currently and am resisting to update because this version is very very stable.

    To help see if this may be Hardware related (Both Computers have similar results):
    Dev1 (Custom Asus Desktop): i7, Win7Pro 16GB RAM, GTX 750ti
    Dev2 (Asus Notebook): i7, Win7Pro 16GB RAM, GTX 660m

    Hope this helps begin to track down the issue.

    Cheers
    O
     
    hopeful likes this.
  15. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    @Olander - hey man thanks for that data!

    I just ran the same test project on another dev machine, still getting the same results that after running a scene with TOD in it, all other scenes lose a ton of FPS. :/ Here are my two hardware setups (I shared here since we are comparing hardware):

    Dev 1 (Custom Desktop): Unity 5.1.1, Intel i5, Win 8.1 Pro, 8GB RAM, AMD R9 270x with 2GB video RAM.
    Dev 2 (Alienware X51): Unity 5.1.2, Intel i5, Win 10 Pro, 8GB RAM, Nvidia GTX 650ti with 2GB video RAM.
    Dev 3 (Custom fileserver build): Unity 5.1.2, Windows 7 Pro, AMD Athlon II X2 260 3.2GHz, 5GB RAM, Radeon HD 6870 1GB video RAM.

    I was starting to think maybe it was my AMD/ATI video card. Made sure AMD Gaming Evolved APP is not installed but that didn't help, and also moving over to a machine with an Nvidia card did not seem to fix the issue either. This is SUPER strange.
     
    Last edited: Jul 31, 2015
  16. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Can you have a look at the Unity profiler to get more info about what exactly is taking up your frame time?
     
    Olander and hopeful like this.
  17. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    @plzdiekthxbye - Yes I can, though now I have 3 machines I have tested on, with similar results. It is going to take a minute to get screenshots of the GPU, CPU and Memory for each setup. I will put them together in a ZIP and send them along to you in PM. Thanks for looking and also apologies for giving you more work. :p Same results in test 3 FYI, blank 1 load up first and hit play, 320 FPS(wow). Stop and load blank 2 with TOD, hit play 150+ FPS. Stop, re-load blank 1, hit play, 160 FPS. I thought maybe its a project setting but if you installed the example project I gave you, you would have same project settings so it seems like it wouldn't be that. Anywho, here is the 3rd build, screenshots on the way.

    Dev 3 (Custom fileserver build): Unity 5.1.2, AMD Athlon II X2 260 3.2GHz, Windows 7 Pro, 5GB RAM, Radeon HD 6870 1GB video RAM.
     
  18. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    He wants to see something like this:


    (my TOD is fine, this is just an example)
     
  19. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    @Tethys Let's also try two things to TRULY see what your actual Frame Rate is.

    1) Turn On V Sync.... Edit>Project Settings>Quality => V Sync Count Every V Blank
    **I am currently using Beautiful or Fantastic with the Frame Rates I wrote above.

    See if that changes anything.

    Next....Add this Script to a GameObject
    http://wiki.unity3d.com/index.php?title=FramesPerSecond

    2) You can Test this with V Sync and without and see if your Editor data is a bit strange.

    Remember that the Stats window is NOT meant for reliable 'Data'....it is meant for letting the designer quickly know which direction the game optimization is going. The report back of this data depends heavily on the hardware of your computer and may be calculating improperly. Happens.

    One other thing that could be related.....in Unity 5 when I 'First' press the Play button it takes some time to fire up. I can see my hard drive on steady as this beast cranks up (52 seconds just now). My project is currently 15gb+ so perhaps this is why....but then again Unity 5 has done that from day 1 for me. After this first press Play Mode I am in the game within 3 seconds. There is additional memory being used.....which makes sense.

    I see you are light on RAM at only 8GB (stunning the different between 8GB and 16GB). Currently I am using 5.2GB of RAM for Unity 5 and Mozilla Firefox and 2 Windows Explorers open. Being that your RAM may be in a similar state....more than 50% of your RAM....Win7 & 8 are trying to figure out what to place in the Page File System. If this Page File is on a 5400RPM drive you could induce some strange issues with live data streams. A 7200RPM drive would also show issues to a lesser extent. The drive may only show 8% fragmentation when analyzed so looks good right? It still may need to be fully de-fragmented then partitioned with the Paging File System the only thing attached to that partition.

    Lastly check your Power Options. By default the hard drives turn off after inactivity. Set up a profile so this does not happen. Also disable USB Suspend since this also can cause issues. When done with gaming/development switch it back to balanced or power saving. Very nice Windows Feature.

    All of these things will heavily affect the hardware. So just a few things to think of to try to help you figure this out.
     
  20. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks for the suggestions.

    Unity is installed on a SSD, project runs from internal HD at 7200, though I don't really see how my performance being awesome without TOD in the scene, and then being reduced so much would have much to do with the HD... but as you mentioned memory maybe its a Unity thing for some reason. Anywho, I put together a set of screenies that is my test scene without TOD. Set A is after running the scene without TOD. Set b is the same scene after running a scene that had TOD in it, then went back and ran the original scene without TOD with reduced FPS. I setup a third blank scene to switch back and forth as well, just to make sure I wasn't getting a hit from simply changing scenes and hitting save. Regarding FPS I have 3 different FPS meters I have tried in the tests, they all show the same result. I haven't really noticed a big difference in the profiler data, but in the GPU screen I am seeing that in instance B when I have now reduced FPS, there is a larger number on GPU ms - its more than double what it was on first run before running TOD. Also you can see on the GPU screen that it's getting 30-60FPS vs the first run that says 100-200FPS. Anywho, thanks so much again for taking time to give suggestions, will keep looking at this to try and sort out the issue. I just find it strange that the same asset does this on 3 different machines, all with different video cards, HD's and operating systems, but again may be a Unity memory thing or something else I am just missing. I do not use vsync obviously, though I will try Olanders suggestions to try and see what kind of results I get and report back. ;)

    Screenshots

    **Update** I am happy to report that I am not seeing this impact in performance on my build that we tested tonight. :)
     
    Last edited: Aug 1, 2015
    Olander likes this.
  21. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Good to hear it's an editor-only issue that doesn't affect your standalone build. All in all the profiler itself looks okay as well. All the TOD scripts are blazingly fast, as it should be, so on the CPU side there aren't any issues at all. The only thing that's a bit mysterious is the increase in frame time in the GPU profiler. Since this increase cannot be seen in the Camera.Render sample of the CPU profiler, we'll have to dig a bit deeper.

    Please open the Camera.Render section in the GPU profiler (click the arrow to the left of it) and continue to open all of the subsections that appear, then take screenshots with and without Time of Day.
     
    Olander likes this.
  22. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    @ksam2 Perhaps you just want to rotate the directional light over time so that it looks like the sun going round?
     
  23. Teo

    Teo

    Joined:
    Oct 31, 2009
    Posts:
    564
    Guys, I have a problem and I can't find any info in docs.

    If I setup a day, is possible to freeze the time, but keep everything else running, eg. clouds?
     
  24. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Deactivate the Progress Time option in the TOD_Time script.
     
    Teo likes this.
  25. Teo

    Teo

    Joined:
    Oct 31, 2009
    Posts:
    564
    Excellent, that was, much simple that I was expected:) Thank! :)
     
  26. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hi all!
    it's possible have a shot of the lighitng window of the scene to be configured to be used by ToD? like sunlight, skybox etc...
    thanks!
     
  27. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Time of Day automatically sets the skybox field if setup correctly (TOD_Camera has to be on your main camera, see the "Getting Started" section in the docs). The only things you have to adjust yourself are the GI parameters. I recommend disabling both dynamic and static GI when using a dynamic day / night cycle, though in certain scenes the dynamic GI can yield decent results - it depends on the size of your world, the speed of the time progression and your target hardware.
     
  28. Megagamefan100

    Megagamefan100

    Joined:
    Oct 24, 2012
    Posts:
    26
    Oh how I wish I knew how to sync the skybox, and this doesn't really help "To network date and time, synchronize the property TOD_Sky.Cycle.Ticks of type long" because I'm not sure how to sync stuff
     
  29. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110
    Hi,

    I am very glad with Time of Day, especially with the realistic sun and moon position, this is exactly what I need for architectural visualisation. But when I have downloaded the last update of Time of Day, an issue shows up.
    I am not sure that the issue comes from Time of Day, but maybe I can still find some help here.

    I use the "dynamic" GI only.
    Some cyan indirect lighting appears on the dynamic GI and I dont know why. It seems to come from the bottom.


    It is more obvious with the irradiance shading mode :


    I tried to tweak the settings in the lighting tab and in the Sky Dome, but I havent found the source of this issue.
     
  30. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    @Hexaedre Can you show a picture of your GI inspector settings, and the material/shader settings for the building?
     
  31. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    I've got a question for you guys that I'm sure someone has come across before. How you you freeze time without freezing the entire game? For example, when the player talks to an NPC, time should stop progressing during the dialogue but the entire game should not be frozen. I suppose I could have a game script that knows if the player is in a conversation and constantly sets the time to whenever the player started the conversation, but I'm hoping there's a built-in method. How is that accomplished with Time of Day?

    Thanks.
     
  32. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110


    The skybox is the one located in Time of Day / Assets / Materials, the Sun is the light from Time of Day.

    For the materials/shaders settings, I use .sbsar from Bitmap2Material 3 and from Substance Designer 4, but also the default standard material from Unity.
     
  33. poinyentsteve

    poinyentsteve

    Joined:
    Jul 8, 2015
    Posts:
    10
    @plzdiekthxbye @toxtronyx I did figure out my London sky not getting entirely dark issue, and it was my error in positioning. I had the camera facing west looking at Big Ben, but the TOD Sky Dome was rotated 180 degree's the opposite way. I also enabled the the Sun/Light to dip below the horizon. While sunrise time still seems a bit early,UTC and daylight savings adjustment seems to have sorted it out for the most part and it's looking good. Thanks for a great asset!
     
  34. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    This is really something you should learn from a tutorial about the networking solution you're using.

    Disable ProgressTime on TOD_Time. You can get a reference to this script using TOD_Sky.Instance.Components.Time.

    I don't seem to be able to reproduce this in my test scene. Do you have TOD_Camera on your main camera? Can you try an empty project with just Time of Day and some primitive meshes, enable dynamic GI and see if you can reproduce it there? If you cannot reproduce it in a new project, try a full reimport in your main project (delete Time of Day, restart Unity, reimport Time of Day). If you can reproduce it in the new project, send that project to me via PM or email.

    That is great to hear! And thanks for reporting back.
     
  35. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110
    Apparently it is not coming from ToD. I removed ToD, rebaked the Realtime GI and it is still there.
    So I oppened a new thread to expose my issue.

    http://forum.unity3d.com/threads/indirect-lighting-issue-unwanted-cyan-indirect-light.348345/

    Thanks for having tried to help me.
     
  36. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    I don't know if the following is a bug or by design: When I drag the main camera around, some clouds are moving along the sky. Maybe it is part of the cloud animation system (cloud layer, not the billboards). However this behaviour causes one major problem: When working with large worlds you usually reset players position from time to time in order to prevent float point problems. These resets become extremely noticeable. I am working with current TOD version and Unity 5.02f1
     
  37. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    This is indeed by design. I'll add a toggle for this feature to the next version.

    Until then, you can disable it manually by replacing the implementation of OffsetUV in TOD_Animation.cs with a simple return of Vector3.zero.
     
    toxtronyx likes this.
  38. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Thanks a lot!
     
  39. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    This is so odd, I just discovered this myself yesterday after implementing a player reset and was planning on asking the question. Great news that it's going to be looked at!
     
  40. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    @plzdiekthxbye

    Can you confirm these about your tools?
    a) Works on Unity 4 and Unity 5.

    b) Possibility to Deactivate Moon, Stars etc... I need ONLY a CLASSIC/STANDARD SkyBox for the Night. Not a CubeMap !!!

    c) Possibility to Deactivate Cloud (ok. just saw this in the web player. Good)

    d) Possibility to Deactivate the Time of Day process. Just need your tool follow the position of an classic/standard light (sun).

    Thanks.
     
  41. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    At the moment yes, though I might remove Unity 4 support in the future.

    Every individual element of the sky dome, including moon and stars, can be deactivated. I don't know what you mean by a "classic skybox and NOT a cubemap" - a classic skybox IS a cubemap, unless you use some custom texture UV layout in the shader. There's a space game object (disabled by default) you can feed your skybox into. You need 6 textures that you assign to a Unity cubemap asset. Certain texture layouts can automatically be imported as cubemaps, as described here: http://docs.unity3d.com/Manual/class-Cubemap.html

    See above.

    The TOD_Time script allows you to toggle time progression.
     
  42. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks for the reply. :cool:
     
  43. Mesher

    Mesher

    Joined:
    May 2, 2013
    Posts:
    19
    Hi, I am having issues with ambient color not updating as time goes on. It just doesn't seem to change at all, my terrain stays the same brightness, doesn't matter if it's day or night.

    Is this a known issue or is it just me? I am using unity 5, dx11, linear, forward rendering

    *edit: it seems to be fine on fresh open of the scene but once i edit some random things in the scene or settings it seems to break "time of day" and the ambient stops working again until I reload the scene
     
    Last edited: Aug 25, 2015
  44. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Are you using GI by any chance? Static GI cannot be used with dynamic lighting (like the one that's coming from a dynamic day / night cycle) at all. Dynamic GI can be used, though refreshing it takes some time, so I recommend using a slow time progression with a fairly high Light.UpdateInverval value.
     
  45. Mesher

    Mesher

    Joined:
    May 2, 2013
    Posts:
    19
    I am using dynamic GI with a high light update and it works perfect upon fresh load of the scene and playing but once i start editing things in the scene, something stops working and i no longer have shadows from the sun or any ambient lighting on my terrain. It also happens when i have built the exe.
     
  46. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Two things:
    • Since you say the issue occurs in a standalone build - are you moving objects that are included in the dynamic GI at runtime? That's not supported by Unity's dynamic GI, only static objects can receive dynamic GI (it's not fully dynamic, it needs to precompute a bunch of stuff about the objects in your scene)
    • If you're only moving objects in the scene in edit mode it's possible that the dynamic GI simply doesn't rebake (is a progress bar appearing in the bottom right?) - check the lighting window and try manually clicking "Build" and see if that fixes it. I'm not sure what the criteria for triggering an automatic dynamic GI rebuild in edit mode are, but in my experience it's fairly unreliable.
    It sounds like an issue with the way you're using dynamic GI rather than something that's specific to Time of Day. To verify this, remove the sky dome from your scene, set the skybox in the lighting window to the default procedural Unity skybox, add a directional light and do the same steps that triggered your problems before.
     
  47. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi there, I'm debating whether to buy Time of Day or UniStorm. I'd prefer to get Time of Day because it has Realistic star constellations and Full longitude, latitude & time zone support (which is fantastic). However, what attracts me to UniStorm is the ability to easily change AI behaviour based on the time of the day. My question is: Is this possible in Time of Day? If so, is it easy to implement? Thanks a lot in advance, btw the realistic star constellations are a wonderful feature, really impressive, well done to the dev.
     
  48. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    @jonfinlay In my personal experience with ToD.....yes....it is very easy. In either system you will need to plug in the 'Time Hour and Minute' to your AI Events. The AI will have this time to chose what and when they should do something. I have it tied into Behavior Designer now as well (changed to this over my own AI System). One note I should mention is that ToD and Unistorm are both in Decimal Hours. You will need a script to change that to proper minute hours. I have a really good Persistent Weather System that directly ties into Time of Day and also has a very accurate Persistent Time system to go with it. The install is very easy....and even if you only want the Time portion it is a free download so you can have a look and see how to get a very robust time system (in Game Minute Hours) into your project (you can also change the Game Day Length as well).

    http://forum.unity3d.com/threads/fr...ers-realistic-weather-for-time-of-day.310180/

    Also in my personal opinion Time of Day is faster and has much better light rendering. Clouds are slightly better in Unistorm but that small difference does not offset the extraordinary lighting of ToD.

    Cheers
     
  49. gbv30

    gbv30

    Joined:
    Apr 15, 2015
    Posts:
    11
    Hello,

    Is there any way to shorten the night cycle with TOD?
    I haven't seen how to do.
    Thanks
     
  50. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    As Olander wrote you have to plug in the times in both packages, which is very easy to do in either of them. To add to his reply I'd like to mention that you can get the non-decimal hours / minutes / seconds in Time of Day by accessing the Cycle.DateTime property, which is a C# DateTime struct and offers a wide range of date and time related properties and utility methods. Time of Day also allows you to subscribe actions to be executed every day / hour / minute to make things easier.

    Check out "Day Length In Minutes" on the TOD_Time component of the sky dome.