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
    I did submit the update on sunday. And then I had to submit 2.0.2 literally a few seconds ago. Update 2.0.1 contained an issue that the new image effect for the sun shafts that also handles clouds correctly would incorrectly overwrite the default sun shafts in the Standard Assets if imported. It's a fairly weird issue that appeared because I started with the Unity image effect and simply renamed and modified the shader, leading to a duplicate GUID for the Standard Assets and TOD sun shafts. You can read more about this issue here, it's probably something every Unity developer should know.

    That being said, the update is on its way and should still make through the review process this week.
     
  2. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    OK, scratch that about clouds - I think I finally figured out how to do raymarched clouds :O
    Goddamn they look pretty!
    Unless you can get them fast enough for mobile, in which case I'd still be rubbing my dollars on the screen (I'm not targetting mobile, but if they're fast enough for mobile that means they're even faster on PC). But still, if you added those to ToD it would seriously be a killer asset for others - probably the best looking clouds on the asset store.
    Still gonna get Time Of Day. I made my own (even had UTC and latitude-longitude support) but I'm not super happy with it. Over time it started to feel like a kludge, so having a professional well-structured asset would ease my OCD I think.
     
  3. EssyTech

    EssyTech

    Joined:
    Jun 17, 2013
    Posts:
    9
    I turned on DX 11 and HDR and my skydome does not look right. Is DX 11 with HDR supported?
     
  4. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    HDR is definitely supported, DX 11 is untested. What exactly is the issue you're encountering?
     
  5. EssyTech

    EssyTech

    Joined:
    Jun 17, 2013
    Posts:
    9

    I know it has to do with the clear flags. Well, the dome gets all funky if I set the clear flags to depth only. When I set the clear flags to solid color and mess around with the solid colors (black), the sky box appears (Very Bright) but does not transition at different parts of the day. If I change the solid color it shows the sky but the base is very bright and the sun does not render correctly. HDR works fine in non DX11 mode.

    $CaptureHDRDX11DepthClearFlags.PNG

    $CaptureHDRDX11SolidColor.PNG
     
    Last edited: Jan 14, 2014
  6. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Do you only activate HDR or are you also using some HDR dependant image effects (tone mapping, bloom, ...) that could cause this in combination with DX11? I guess I'll have to install Unity Pro on my Windows partition and see for myself - I won't have any time to do this before the weekend though.
     
  7. EssyTech

    EssyTech

    Joined:
    Jun 17, 2013
    Posts:
    9
    I went to the provided demo scene turned on HDR (while in DX11 mode) and I had the same result as my own scene, to make sure it wasn't any thing in my scene. When I get to the office I will start a new project and add your asset only and see if it does the same thing. I will let you know.
     
  8. EssyTech

    EssyTech

    Joined:
    Jun 17, 2013
    Posts:
    9
    I found the issue: I loaded a new project. If you go to the demo scene (terrain) and turn on DX11, HDR + Foward Rendering, it works fine. The deffered rendering path with HDR is the issue in DX11. Deffered rendering with HDR works fine in DX9. To reproduce the issue do the following:

    DX11 + HDR + Deffered Rendering (Not Working)
    $DX11DefferedHDR.PNG

    DX11 + Deffered Rendering + NO HDR (Works Fine)
    $DX11DefferedNOHDR.PNG
     
    Last edited: Jan 15, 2014
  9. czliao

    czliao

    Joined:
    Sep 10, 2013
    Posts:
    2
    Hi,

    I just bought TOD after reading all the positive feedbacks. I am facing a very simple problem: I can't find the customization window as shown on your screen shots of the product page. I would like to set the lat/lng of the project, before anything else.

    Would you mind letting me know what am I missing?

    This is all I am seeing right now:
    https://www.dropbox.com/s/87npeene2xyw36i/Screenshot 2014-01-15 21.31.44.png

    But not this:
    https://www.dropbox.com/s/waoiohmzu733eub/Screenshot 2014-01-15 21.35.11.png

    Any help would be appreciated.

    – Joe.
     
  10. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    It's normally under the TOD_Sky (where it says "Multi-object editing not supported" in your screenshots). Have you tried deselecting the sky object and re-selecting it?
     
  11. czliao

    czliao

    Joined:
    Sep 10, 2013
    Posts:
    2
    Deleted and reimported the package did the trick. I moved the folder into 'plugins' probably was the problem. Anyhow it works now, thanks so much for prompt response.
     
  12. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    2.0.2 is out!

    Thanks for all the details on this, I'll investigate this weekend.

    I believe "Plugins" is for native code only, so don't put any Asset Store purchases in there if they're not automatically placed there.
     
  13. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Not necessarily. You can place regular scripts there too, as well as .NET DLLs. You can't put Editor scripts in there, however.
     
  14. ThunderTruck

    ThunderTruck

    Joined:
    Sep 25, 2013
    Posts:
    61
    Hi, I've just update to 2.02 and I have notice of 2 issues that were not there before...
    1) In DX11 deferred rendering Atnosfere is black
    2) Progress Date don't work (just work in your example)

    My workarounds:
    1) Modify the atmosfere shader at line 142 "Add simple moon halo" the pow value <= 8
    2) In TOD_Component.cs I have added --> Time.enabled = Time.ProgressDate;
    In the Event "OnEnable()" How in yours example scripts.
    -->Time.ProgressDate bool value alone don't stop progress time
     
  15. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I don't test on DX11 at the moment, but I will do so starting with the next update.

    Not sure if I understand you correctly here. ProgressDate should toggle whether or not the day, month and year are being progressed - the time itself will always be progressed if the script TOD_Time is enabled.
     
  16. ThunderTruck

    ThunderTruck

    Joined:
    Sep 25, 2013
    Posts:
    61
    You're right, just disable the script ... Oops!

    However, for those who do not know, shadow projectors have problems with semitransparent objects but just use layers to hide the objects in the shadow projector...

    Anyway, great asset
     
  17. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Might it be possible that you access the materials not directly? It's annoying to see them every time in the version control.

    $Bildschirmfoto 2014-01-17 um 15.09.45.png
     
  18. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I would like to do so, but if I access material instead of sharedMaterial Unity will leak materials as the sky script is being executed in edit mode with the following error: "Instantiating material due to calling renderer.material during edit mode. This will leak materials into the scene. You most likely want to use renderer.sharedMaterial instead."

    You could work around this by removing [ExecuteInEditMode] from the TOD_Sky class, but most users will want to see the changes they apply in the inspector to immediately have an effect on their scene without pressing play.
     
  19. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I had time to test on DX11 and fixed all issues I could find. I will submit full DX11 support as update 2.0.3 this weekend. For those of you who would like to test and verify, here are the changes:

    File: Time of Day/Assets/Shaders/Atmosphere.shader

    Line 143
    replace max(0, pow(dot(TOD_LocalMoonDirection, -v.normal), 10))
    with pow(max(0, dot(TOD_LocalMoonDirection, -v.normal)), 10)

    Line 151
    add o.color.a = saturate(o.color.a);
     
  20. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Figured I'd post some screenshots of Time of Day in my project. Added a custom raymarched cloud shader to it :)

    $Scattered.png
    "Scattered" cloud setting

    $Broken.png
    "Broken" cloud setting.

    $Overcast.png
    "Overcast" cloud setting. Dithering becomes very noticeable, so I'll probably dial back the dithering at higher cloud densities.
     
  21. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Looking very nice! As a remark to the rest of you: Me and PhobicGunner actually combined our efforts in providing ray marched clouds for TOD in an out-of-the-box usable solution. More information on this as the project comes along.
     
  22. SiBlack

    SiBlack

    Joined:
    Jun 12, 2013
    Posts:
    22
    Hi,

    I've got a coding query.

    The camera for my game is created at run-time from a prefab, so I'm not able to define 'Sky' in the TOD_Camera and TOD_Sun Shafts components.

    I assume I need to edit these scripts by adding a void Start(). I ain't a coder so tried this;

    void Start ()
    {
    sky = GameObject.Find("MoonSky");
    }

    Where MoonSky is the name of the skydome prefab in the scene.
    Naturally it throws up this error: Cannot implicitly convert type `UnityEngine.GameObject' to `TOD_Sky'.

    What do I need to do to make this work?

    Thanks.
     
  23. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    The custom raymarching cloud shader....oh so nice. VERY nice.
     
  24. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Code (csharp):
    1. void Start ()
    2. {  
    3.     sky = GameObject.Find("MoonSky") as TOD_Sky;
    4. }
    I would recommend doing this in a separate script though because then you will be able to upgrade to future versions of TOD without adding this section again and again.
     
  25. SiBlack

    SiBlack

    Joined:
    Jun 12, 2013
    Posts:
    22
    Thanks for the quick reply. Sadly it didn't work. I get the following error;

    Cannot convert type `UnityEngine.GameObject' to `TOD_Sky' via a built-in conversion.
     
  26. SiBlack

    SiBlack

    Joined:
    Jun 12, 2013
    Posts:
    22
    Solved it with the following. Thanks for pointing me in the right direction :)


    Code (csharp):
    1. public class CamSetSky : MonoBehaviour
    2. {
    3.     private GameObject moonSky;
    4.  
    5.     private TOD_SunShafts Shafts;
    6.     private TOD_Camera Cam;
    7.    
    8.     void Awake()
    9.     {
    10.         moonSky = GameObject.Find("MoonSky");
    11.  
    12.         Cam = GetComponent<TOD_Camera>();
    13.         Shafts = GetComponent<TOD_SunShafts>();
    14.     }
    15.    
    16.     void Start ()
    17.     {
    18.         Cam.sky = moonSky.GetComponent<TOD_Sky>();
    19.         Shafts.sky = moonSky.GetComponent<TOD_Sky>();
    20.     }
    21. }
     
  27. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Oh yes, I mixed up GameObject.Find and the non-generic version of GetComponent there in the hurry. Good to see you fixed it on your own.
     
  28. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I actually just found a way I might be able to fix this, could you send me a PM or email if you would be interested in testing it?
     
  29. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Okay now that 2.0.3 is out I thought I'd take a moment to discuss the roadmap for the upcoming weeks.

    I will release update 2.0.4 some time in the upcoming weeks. It will finally fix two rather annoying things in the editor. The first being the fact that TOD always modifies the scene it's being placed in because the scripts constantly update game object positions and other things, leading to an unpleasant reminder to save the scene every time one closes it. The second one probably affects fewer users but is even more annoying - TOD modifies the materials, leading to them always showing up in the version control system. Both of those things have been adressed without any drawbacks for the user. It was a little painful for me to do though.

    2.0.4 will furthermore merge the 3 prefabs into one and offer quality controls via the inspector directly on the prefab itself. Cloud quality and mesh quality can be adjusted separately - both in the editor and at runtime - using public enums. This was also part of the preparation to offer ray marched clouds in a future update as it offers great expandability without making the system any more complicated to use or any slower on low end devices.

    Last but not least I improved the visuals of all cloud shaders (especially of the highest quality setting) and addressed the fact that the "Medium" and "Low" shaders didn't look identical in linear and gamma color space. I did all this without any performance hit on low end mobile devices by optimizing all changes as much as possible and saving a few interpolations from the vertex to the fragment shader.

    Now for update 2.1.0 I plan to include one or two additional cloud quality settings: 2D / 3D ray marched clouds. PhobicGunner already posted screenshots of his hacked shader, and we took some time to talk about his implementation and what I'm trying to achieve. I feel like I should invest some time to get this right rather than rushing it out the door, so that's why I won't announce any ETA for 2.1.0 just yet. At this point I don't know whether or not full 3D clouds you can fly through will be part of 2.1.0, but at least 2D clouds should be included.

    Finally I would like to thank everybody who supported me over the course of my first year as a publisher on the Asset Store. Time of Day grew from being a side project of a young student from Germany to being a serious product on the Asset Store. You guys were always pushing my motivation to make it even better, and so far every hour I put into it paid off.
     
  30. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Glad to hear about your awesome plans for ToD! Have been really impressed with how good cloud shading has gotten over the last few updates, looking forward to the next one..

    Just as I was watching dusk today, I remembered.. what ever happened to "earth shadow in atmosphere"? :D remember, doesn't have to be physically correct calculations or full-blown simulation, just a somewhat plausible darkening tint on the lower band of the horizon opposite to the setting sun..
     
  31. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    I love roadmaps, thanks for that and your great product!
     
  32. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I guess I could add this in one of the next updates.

    Thanks!
     
  33. Evil_Echo

    Evil_Echo

    Joined:
    Sep 30, 2011
    Posts:
    48
    Agree that ToD is evolving into a more fascinating system with each release.

    Don't forget about easy to use programming interfaces and extra-solar support. :)
     
  34. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings plzdiekthxbye, we love Time of Day - everything worked great out of the box. Now we have a question. :)

    With Marmoset Skyshop being on sale now we are thinking about finally picking that up. However, still a pretty big noob to IBL - would it be possible to make Time of Day work with Marmoset? Would it be something you would consider extending to work for a client (maybe some paid for hours on the side)? Love those shaders and if there was a way to get these two systems working together it could be really nice. Thanks for your time.
     
  35. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Currently we use Marmoset and ToD together without any issue. The only thing I didn't test yet is to create a CubeMap from inside the scene, but that shouldn't be a problem.
     
  36. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Thanks for reporting. I don't own Marmoset myself, but I might pick it up at the sale to be able to provide support regarding the combination of Marmoset and Time of Day. Does Marmoset feature cubemap interpolation by now or is the best way to handle dynamic lighting still to simply bake a lot of cubemaps and swap them out via script?

    Regarding the release of 2.0.4 - I planned to submit it today but it looks like I'll have to invest some more days into testing as I made some changes to the shaders until a few minutes ago. I don't want to rush the release to make sure there aren't any unpleasant bugs in there, so I'll take this week to test on as many platforms and with as many settings as I can and hope to submit it over the upcoming weekend.
     
  37. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    A little teaser for 2.0.4 - the new "Low" cloud quality, no performance hit compared to the old one:

    $Screen Shot 2014-02-04 at 18.02.01.png

    Don't worry, the higher quality levels also got some love.
     
    Last edited: Feb 4, 2014
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Very nice! :)
     
  39. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    I will submit 2.0.4 today as planned. I updated the web player and documentation, also make sure to check out the changelog.

    As always, the update should go online a few days after the submission - so you can probably expect it mid next week.
     
  40. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Hi
    I just bought Time Of Day since I am in need of a good and performant skydome / weather system. I love how contrasty the sky is in TOD, I love details like cloud shadows and how flexible TOD is in use.
    See. I also have unistorm, which ist very nice as well, but it has no transitions, you can't change the directon of your skydome and Unistom eats a lot of performance.... This is why I am so happy to have TOD now, because it is super slick when it comes to performance. Thumbs up for that!

    Question:
    I haven't looked too far into TODs functions, but i know that there is a smooth transition between weather and cloud types.- awesome... The only thing I have not found is a function that randomly pics the weather in the cycle. Did I overlook that or do I only have an option to pick the weather by myself?
    It were nice to have a control system that calculates the odds for certain weather types in every season of the year. Or maybe something like a pattern generator in which I can choose a pattern for my weather. You know , something like a trigger that changes the weather four times a day with an option to set how high the odds are for bad weather and sunny days. Or similar... whatever makes it easier to have an automatic change.
    Is there any chance that this might happen?

    Keep it up :)


    ...
     
    Last edited: Feb 14, 2014
  41. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Not to be a negative nancy, or argue for less awesome features...but it seems like the weather control system is more of an external system, instead of something that should be a part of TOD. This is just my humble opinion, but I would rather TOD focus on what it does best, shows sky/clouds in all their glory and let other systems tell it what time it is, what clouds to show, etc. I've seen other systems get weighed down with other features like leaves falling, butterflies flying around, and weather itself like rain and such. Development slowed to a crawl, and usually those systems were implemented in a way that some wanted, but not others.
    That's just my $0.02 :)

    Here's another $0.02...as far as clouds, I personally don't care if clouds are "true" 3d and with volume that you can fly through. Just having 3d looking clouds is a neat step forward. But that's just adequate for my project, I realize it may not be for others.
     
  42. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Thanks a lot, good to hear you like Time of Day so far.

    I agree that a randomized weather manager should be very easy to implement in a small script by yourself and shouldn't be hardwired into Time of Day. That being said, requests like that are what I created the "Examples" folder for, where I already put in some scripts people tend to ask me for, and I could imagine this being an addition to the examples in a future update (after I'm done with the roadmap I pointed out so far).

    2D raymarched clouds will definitely come in 2.1.0 and that should provide really nice visuals on the ground for higher end machines. 3D raymarched clouds are something I also want to do but I cannot promise it for 2.1.0 just yet (meaning it might be in it, but it just as well might not), especially since I have other projects to work on and I simply can only justify spending so much time on Time of Day before I have to pause development to deal with all the other stuff I do.
     
  43. OneShotGG

    OneShotGG

    Joined:
    Nov 16, 2012
    Posts:
    225
    One of my artists asked me this and I didn't have an answer so I will ask here.

    When passing by the moon or sun do the clouds change their brightness or color? Furthermore are you going to have cloud color be affected by sunset/sunrise?
     
  44. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Hi, it's me again
    In case you don't know: There is a little flaw in your asset. As soon as you activate Clouds/Shadow Strength in the Sky Dome settings, all trees belonging to a terrain will have a wrong cut so that the blank background (or another skybox if you have one) will show through. I attached a screenshot showing it. The wrong effect disappears as soon as you deactivate cloud shadows
    Just FYI :mrgreen:
     

    Attached Files:

  45. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Yes, both are already part of Time of Day.

    I'm still not sure when this appears exactly. The cloud shadows are essentially a default Unity projector, so there's not much I could change there. Did you load up the demo scene and verify that this doesn't happen in there, even with cloud shadows enabled? Which image effects are you using on your camera?
     
  46. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Haven't checked it with the demo alone, but with another project that is basicaly a blank field with a few trees. Same result.
    I should add that i work with instanced player characters and have to pull all your references in advance so they are forwarded as soon as my player spawns. However, I can't imagine this to be the reason for the flaw. I will check the demo soon.
     
  47. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    The reason I'd like you to test the demo terrain scene in your project is that if the issue persists we are certain that a project setting is causing the issue. If the demo scene works it has obviously something to do with your scene setup, most likely a camera setting or image effect.

    That shouldn't be an issue.
     
  48. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Great asset! My question is even with the Time script disabled (the sun not moving on it's own), i'm still getting movement in the edge of the shadows. And areas in my scene with a number of horizontal edges are getting 'anti-aliasing crawl' for lack of a better description. Whats causing this and how can I stop it.

    Also, I just started using this today so forgive me if this has been covered. But is there a way to export sky settings, It would be great to easily apply them to a scene or even share here in the forum.

    Lastly. Is there a way to tweak the sky to have a much more dramatic look. Don't get me wrong, I love the asset, but it looks like i'm standing in my front yard on a Tuesday afternoon. There is a popular static sky package available on the asset store that I would like to try to get my sky's too look more like. Thank you!
     
  49. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    What you're describing is a general issue with shadow maps and especially Unity's smoothing algorithm. If you disable both the time progress and don't move the sky dome to the player position you will still see some artifacts. Your can reduce the shadow distance or increase the shadow resolution to improve the situation or try out one of the shadow improvement packages from the Asset Store to either improve the shadow map smoothing or to use shadow volumes for at least moving objects instead. Other than that there's not much you can do.

    That's not possible at this point, but thanks for the suggestion.

    There's no one-button-configuration setup that will fit everybody's vision of a "dramatic" sky, so I'm afraid you'll have to play around with the parameters yourself. The documentation describes what every parameter does exactly - you should be able to tweak them one by one until you're fully satisfied.
     
  50. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    is this for iOS/Androids or also good for computer games?