Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Time of Day - Dynamic Sky Dome

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

  1. exploitedtaken

    exploitedtaken

    Joined:
    Feb 25, 2014
    Posts:
    19
    I have a problem with scattering and reflection.Almost every reflection (planar,ssr) I getting this black sky. The images will tell you whats the problem. Here;

    http://imgur.com/a/QHObz
     
  2. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    158
    I have an issue in that my project has to run on Unity 5.4, TOD currently kills all realtime lights from functioning in my scenes, which is a bit of a show stopper, I'm not sure what's causing it but serious lighting issues are not what I want. Given the quoted update above are you able to provide any further clarity on how long we may be waiting for an official release as I'm not overly keen running an internal build as that sounds like "no support" to me. Given you said next month on Aug 12th I'm assuming we might be closer to an update?
     
  3. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    AFAIK you just have to comment out the "Profiler" calls in TOD_Sky+Unity.cs or update it to the namespace changes. I'll fix it in the next update, though with beta releases it's always possible that you have to manually apply changes simply because they change so quickly.

    Unity's planar reflection script is indeed not working out of the box since it's using a OnPreRender / OnPostRender hack. You can fix this by setting Components.AtmosphereRenderer.enabled to true in OnPreRender and false in OnPostRender on the planar reflection script. SSR works fine if it falls back to the current reflection probe on reflection misses, as it should be doing.

    Closer, yes. I would still recommend you to get the latest internal build since so far there haven't been any issues for the people that are using it. I also posted the changes you need to do to fix this a few pages ago, so you can look it up in the thread and apply them manually if you prefer that.
     
    hopeful likes this.
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,160
    I'm setting up some scenes to load additively into the main scene, with TOD being in the additive scene. At runtime, the scene is loaded, but the "Light" intensity is set to zero, even though it's set to .85 in the Sky Dome inspector. I can't adjust it unless I pause the game, and then it reverts to zero when I unpause it.

    Then I realized that the main camera is in the main scene. so TOD gives me a warning about the TOD_Camera script not being assigned to the main camera. So I assigned that script to the main camera in the main scene, but TOD doesn't find it after the additive scene is loaded. Is there a way to do that?

    As a hack, I tried adding a camera to the additive scene, put the TOD_Camera on it, and then disabled the camera component. That got rid of the warning, but didn't solve the problem with the Light intensity being zero. (I'm not even sure if the TOD_Camera warning is the cause of the Light=zero problem, but it's all I've thought up that might be...)

    Any suggestions?

    thx
    Dave
     
  5. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I'm having an issue with ToD and UFPS. More specifically, the Atmospheric Scattering script with UFPS's weapon camera. With both on, I get a black sky and no scattering. If I turn scattering off, I get a normal sky. If I turn UFPS's weapon camera off, normal sky and scattering works, but no UFPS anti-clipping functionality.

    I tried adding ToD scripts to the weapon camera, but that broke everything.

    I can run with no weapon camera for now, as I can't do without scattering. But it would be good to have a fix.
     
  6. f1ac

    f1ac

    Joined:
    May 23, 2016
    Posts:
    65
    This stopped working in Unity 5.4.2 for some reason, billboard trees are unaffected by scattering. Not sure how to fix it.
     
    Lesovoy likes this.
  7. Lesovoy

    Lesovoy

    Joined:
    Mar 18, 2016
    Posts:
    7
    I have the same question because it doesn’t work in 5.3.3 with «ColorMask rgb» deleted and with ransparent-100 set to -500 doesn’t work too. Frustrating.
     
  8. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    283
    Hey @plzdiekthxbye

    Any plans to restructure TOD_Sky.UpdateCelestials? To be blunt, it's a real mess, and it stands out as a real mess in the otherwise well written plugin. It seems silly that there isn't a componentised, static exposure for the position of the sun and moon, and it's just written... really weirdly.

    For instance, it would be great to be able to ask TimeOfDay, without needing a skybox object actually running, where the sun would be given some relevant set of parameters. Not particularly possibly right now to extract that from the spiderwebs.

    Edit: As a follow up on this, it seems right now that the TOD Atmospheric Scattering image effect doesn't work for terrain tree billboards. Is this a known bug, and is there a fix in the works?
     
    Last edited: Oct 27, 2016
  9. WalterCC

    WalterCC

    Joined:
    Mar 29, 2014
    Posts:
    4
    Hi,
    For mobile develop, I think this system is awesome.
    It seems there is also many code warning in current version. Hope will be fix soon too.
    What's the next release date? Or is there a discount in near future?
     
  10. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    You need to set the TOD_Sky.Instance.Components.Camera reference to your TOD_Camera script on the main camera. This reference is usually set by the TOD_Camera script on start, but since it couldn't find the sky dome at that point it remains unset.

    I don't know how the camera works exactly, but have you tried adding it to either the main camera or the weapon camera? All TOD_Scattering needs are valid depth values, if those are discarded by some other script there's frankly nothing I can do about it on my end. It's likely that the UFPS camera does some depth buffer hacks to get rid of the clipping (like pushing back the depth values) and makes them unusable for image effects in the process, in which case you would have to guarantee that TOD_Scattering is running on the main camera before the weapon camera does anything.

    You can use the frame debugger to check if the tree billboards are writing correct depth or alpha values (either one of those is required so the image effect can work with them). I would recommend converting the tree billboard shader to be cutout and write to depth, like the SpeedTree billboard shader is doing. This seems to be where Unity is heading, and sadly they don't plan on providing such a shader for their legacy trees.

    I agree with with you, but sadly those equations are just this ugly by nature. The way I'm doing it is the fastest way of calculating the correct sun and moon position that I know of. It contains a ton of precalculated "magic" constants, which makes it anywhere from difficult to impossible to understand. Planetary orbits are just too irregular for a solution that's both beautiful and fast - anything else would either be much slower or not true to life in terms of eclipse dates etc. One thing I might indeed change is to move that code to a separate script and add it to the sun and moon child objects with the constants exposed as parameters somehow. That way you could at least add more planets or suns and have them move automatically, which I think quite a few people would like to do.

    No discounts planned. I can send you the latest internal build if you email me your invoice ID. Still hoping to find some time soon to wrap it up, write the changelog and update the docs.
     
    hopeful likes this.
  11. Matthias1231

    Matthias1231

    Joined:
    Aug 20, 2012
    Posts:
    53
    I also have an issue with reflection, not sure if it is the same as exploitedtaken.

    In a multi camera setup, the sky reflections in the water are messed up, almost like as if the clouds are reflected multiple times. The image below is with Aquas but the same thing happens with the Unity Pro Water.

    It works fine with a single camera setup but I rely on multiple cameras for several features.
    I've tried about any combination of stuff and can't make it work.

    Any advice?
    Thanks!
     

    Attached Files:

  12. SazanOFF

    SazanOFF

    Joined:
    Oct 20, 2014
    Posts:
    11
    Hi! thx for asset) its very beautiful, but i have one big problem with fog. Why unity fog ignore sky? how i can fix this?
    I use Deffered Lighting + Gamma (Unity 5.3.5)
    http://prnt.sc/d4ed13
     
  13. Matthias1231

    Matthias1231

    Joined:
    Aug 20, 2012
    Posts:
    53
    I have determined that this is not a Time Of Day issue but also occurs with the generic Skybox.
     

    Attached Files:

    ftejada likes this.
  14. joelcarlson

    joelcarlson

    Joined:
    Apr 7, 2014
    Posts:
    43
    TimeofDayHelp.jpg Hi there! I'm working on a mobile title where the user is quite high above the Earth's surface. As such, I've rotated the cloud gameobject 180 degrees so it appears below the user. My goal is to duplicate the cloud gameobject, scale it so it appears a bit below the first cloud gameobject, and multiply the color to appear as a cast shadow on the ground. Unfortunately, my knowledge of shaders is zero. Any help on how I may implement this? Many thanks! - Joel
     
  15. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Any news on when cloud shadows should be working again? Is this already fixed in the itnernal version, or is it still waiting for fixing?
     
  16. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    283
    I'm sure me and most of the TOD userbase would trade realism for a well structured codebase any day of the week, or at least one where the realism is optional and modular and doesn't have it's spaghetti hooks all over the place. While it is a pleasant gimmick that the celestial bodies are realistically simulated, it is by far not the selling point of this asset.
     
    bluemoon likes this.
  17. Akshara

    Akshara

    Joined:
    Apr 9, 2014
    Posts:
    100
    Actually, accurate celestial bodies is the sole reason that I chose Time of Day over other sky options. Not saying that options and well structured code aren't welcomed. Just voicing support for keeping this feature, as it is an important aspect of the work that I am doing and is my favorite feature of Time of Day.
     
    Last edited: Dec 1, 2016
  18. left_brain

    left_brain

    Joined:
    Jun 21, 2016
    Posts:
    22
    I'm using Time Of Day but I do not want to use the day / night transition, since I need to use Baked GI in my scene, so I deactivated the time progress in SkyDome, now the problem is that the sunlight and the moon need to be static , I can not just leave the entire dome static, since it would cause problems in the clouds, have some problem if I leave only the static sunlight and moonlight inside the dome, since I need to move the position of the dome to the same camera constantly , To prevent the player from leaving the dome?
     
  19. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    The short answer is that the water shader that comes with the Standard Assets is horribly outdated, which is also why it's not working with the default skybox as you found out. It should be using reflection probes for its reflections instead of the planar reflection hack. There are solutions on the Asset Store that do this.

    You should use the TOD_Scattering / aerial perspective image effect for fog that blends with the sky. The default fog ignores pixels that are in infinity (i.e. any skybox), which makes sense for the use cases it was written for.

    They're working in the internal version, contact me with your invoice ID to receive it.

    I don't think this is true in this case. This code doesn't really affect the "codebase structure" at all since it's isolated in a single method. As I said, I do think it would be a good idea to move it into a separate script so it can be used on multiple suns or moons.

    I would disable the light source game object in this scenario and add your own light source that's marked as static. You can then use that light source for baking.
     
    hopeful likes this.
  20. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @plzdiekthxbye Updated Unity to 5.5 and got this error with TOD
    Assets/Time of Day/Assets/Scripts/TOD_Sky+Unity.cs(63,3): error CS0103: The name `Profiler' does not exist in the current context

    is it compatible with 5.5?
     
  21. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    455
    @Ascensi you need to add
    Code (CSharp):
    1. using UnityEngine.Profiling;
    or simple edit your error to
    Code (CSharp):
    1. UnityEngine.Profiling.Profiler.BeginSample("Creating additionalVertexStream Data");
    note: that's might be updated when you upgrade your project, if not happens you need to edit manually
     
  22. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    The automatic script updater (should ask you when first opening your project) will take care of that, but I can also send you the latest internal version where this is already fixed. Just send me your invoice ID via email or PM.

    Doing this manually indeed also works as a temporary measure.
     
  23. 3Dynamo

    3Dynamo

    Joined:
    Mar 3, 2013
    Posts:
    8
    Hi i would need the internal version with this fixed please.i´ve tried to fix it manually but i couldn´t.
     
  24. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    See my reply:

    Once you did that I will send you the link.
     
  25. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi... just updated to 5.5, in process of updating third party assets and fixing errors with the upgrade.

    Seems like even the newest version of TOD is not working correctly in Unity 5.5. I get weird lighting from below in my scene, don't know exactly what it is, most probably errors with the env gradient being overly bright or something.

    Also I had to fix a ton of these errors: Assets/Time of Day/Assets/Scripts/TOD_Sky+Unity.cs(45,3): error CS0103: The name `Profiler' does not exist in the current context


    Any idea what is going wrong? Do I also need the internal version to get TOD working again in 5.5?


    Thanks and regards

    Gian-Reto
     
  26. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    You require the internal version for full 5.5 compatibility until I upload it to the Asset Store. Alternatively you can also run the automatic script updater that comes with every Unity release or manually add "using UnityEngine.Profiling;" to the TOD_Sky+Unity.cs file.
     
  27. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    I have received the internal version... thanks for the quick processing.

    I have imported the newest version (sadly I see nothing to confirm that I got the newest version running, the documentation still refers 3.1 as latest version in the changelog), but I cannot for the life of me get the cloud shadows working.

    I have added the TOD_Shadows script to the camera. Yet no matter what I do, I do not see any cloud shadows appearing anywhere.
    Could this be caused by the shaders I am using (UBER, custom Speedtree ones, and RTP terrain shaders)? Could it be another image effect blocking it?

    What should I try next to find out why I do not get cloud shadows working?


    Regards

    Gian-Reto
     
  28. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    It's working here on 5.5.0f3 with the latest internal Time of Day version. Create a new scene in your project, add the sky dome and a scaled cube as the ground. If you then add TOD_Shadows to the camera you should see the cube being shadowed. If this does not work try the same in a new project with just Time of Day in it. If it works there, try a full reimport of Time of Day in your existing project (delete Time of Day folder, restart Unity, reimport Time of Day).
     
  29. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Got it to work, after testing the internal version in a separate project and then in a separate scene of the original project, with working cloud shadows in both setups.
    Turned out all I had to do was to duplicate the sky box game object, and deactivate the original one. Reassign the TOD Scripts to the camera, and cloud shadows are now working. Guess the scripts were not refreshed until I duplicated the skybox.


    Some thoughts:

    - I really like the cloud shadows, they look pretty convincing. The one thing that irks me is that they seem to have no effect on the shadows of the directional light.
    Maybe I am expecting too much here, or maybe this is technically not possible. But it would be extremly cool to have some replacement shader for the default screenspaceshadow shader that would detect the cloud shadows UV Map, and could modulate the shadow strength for shadows that fall into the cloud shadows... so that the resulting shadow strength would be "lightShadowStrength - cloudShadowStrengthAtWorldPosition", just for the directional light in the scene (other lights shouldn't be affected, if that is even possible).
    Currently the strong shadows still cast by the directional light even when covered by a cloud shadow makes results in a quite transparent looking cloud at best. If the directional shadows are set to fulls strength, it just looks off.

    - I see no cloud shadows going on during the night. Is this expected behaviour, a bug, or did I mis a configuration somewhere?

    - Given that there are a TON of settings to make in the skybox object, it would be cool to have some way of serializing/saving all the settings to a file, and load them again to overwrite the settings in the skybox object.
    For one to transfer setttings after a TOD version upgrade, when you had to remove and re-add the skybox to the scene. But also to quickly setup a new scene with a similar setup that you already had in a different scene or project. Hell, users could even send other users their setup quick and easy.
    Given how much of a pain getting all those gradients set to the same values again, that alone would make a save/load option a cool addition.


    EDIT: After spending some time analyzing the screenspaceshadow shader currently used in my project, I guess this would be the wrong thing to look towards for implementing these things.

    After all, the simplest solution still is the best to implement cloud shadows: A simple cookie for the directional light does exactly what I would like to achieve, interacts with the shadows in a realistic way....
    Of course, that only really works for a static sun placement because the cookie itself is static (unless you swap it out all the time to get an "animated cookie", haven't tried that)... and you need to be able to move the directional light in a certain direction to fake cloud movement, which is problematic with ToD as the light already gets moved by the ToD scripts and interfering with that leads to unexpected results.
    Then there is the thing that you should be able to fade out the effect as the sun gets closer to the horizon.... which again, unless you can just swap out the cookie during runtime and have multiple cookies to get an "animated effect", is not going to work.

    Lets hope that Unity will improve the options available for light cookies so we can move the cookie UVs for animated effects, and assign an alpha value for fading the effect out. Given how useful cookies could be for faked shadows, that would be great.
     
    Last edited: Dec 21, 2016
    hopeful likes this.
  30. Auto-Bot

    Auto-Bot

    Joined:
    Feb 6, 2014
    Posts:
    287
    Deprecated? No update since Jul 01, 2015. Errors out the wazoo on import on latest release.
     
  31. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Contact the developer... they have an internal version that should work fine with Unity 5.5, but hasn't gone through verification for the asset store yet. Send them your invoice / order number and you'll get the internal version.
     
  32. Auto-Bot

    Auto-Bot

    Joined:
    Feb 6, 2014
    Posts:
    287
    Ah cool. I should have looked up a few posts. Cheers for the information!
     
  33. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    24
    Hi to all! This is great asset, you know that already :)
    I was just wondering, could it be used for space scenes? The same techniques to be used, one xample, for creating cosmos scenes, with randomization or customization? Feature like that will multiple the value of this plugin :)
    Is there any possibility (some trick), at this moment, to get stars displayed in whole sphere, up and down so to cover complete skybox? That should be more then enough for start...
     
  34. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,864
    I've recently switched back to TOD from uSky due to some target hardware issues and I'm pleased to say that I am happy with the look and performance of the current version. I have a couple of things to note, however.

    First, I think the clouds are still a bit of an issue when you have mountains in the terrain. They end up looking like flat sprites cutting into the mountains so not really usable in that scenario.

    Second, I like the atmospheric scattering effect, but it seems overblown and I can't seem to find a parameter that will tone it down. Any ideas on how to tone the effect down more?
     
  35. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Is it possible to have a textured skybox, where clouds/sun are over that.. then say for night it fades out for the procedural stars etc//
     
  36. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    129
    I found what seems to be a bug.

    When pausing my game using Time.timeScale = 0 ( to make my pause menu ) ,the Fogginess parameter in the Atmosphere group changes its value to NaN, which messes up all my game screen.

    Setting Time.timeScale = 1 and setting Fogginess back to 0, everything works again.

    Setting Time.timeScale = 0 should not change anything in the TOD.

    I am using Unity 5.6.0b3 Beta, but the problems happens in other versions to.

    Can you fix it ?
     
  37. Artpen

    Artpen

    Joined:
    Jan 24, 2015
    Posts:
    156
    Hi plzdiekthxbye,
    Could you please send me an updated version which works on Mac Unity 5.5.0p4?
    Thank you
     
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,864
    Judging by the lack of support responses this appears to be another abandoned thread. Time for me to use their support contact on their website. I don't think we're going to get any answers here.
     
    Last edited: Jan 17, 2017
  39. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    It's only been a month(less than by a few days really) since the author posted last and that month happens to be one where a lot of people go on vacation. Let's give him the benefit of the doubt.
     
  40. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    That's not really the right scenario for Time of Day since its main feature is atmospheric scattering. You can adjust the stars shader so that it displays both above and below the horizon, but I doubt you'll get great results for this type of scenario without making significant changes to the atmosphere shader.

    Replied to your email.

    You can currently only use a custom skybox at night. However, for hand painted clouds you can use the cloud billboards.

    Solved via email. For everyone else: this was caused by FadeTime on the weather manager being set to zero.

    Send me your invoice ID and I'll send you the link.
     
    hopeful likes this.
  41. dhamel

    dhamel

    Joined:
    Jan 30, 2017
    Posts:
    2
    I'm very new to coding. Using Time of Day for architectural VR in Vive. I'm trying to figure out a way to use the Vives trackpad to scroll through hours of the day and have the sun move. I'm not sure if this should just be a simple script added to the camera calling to the TOD_Sky hour cycle parameter or should I add lines inside the TOD_Sky script itself? Maybe someone has already created this control?

    Thanks for any help,

    Dave
     
  42. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,063
    I too have this issue since upgrading my project to Unity 5.5

    TOD_Scattering is completely blocking my background trees etc even if I set Global density to 0. In Unity 5.4 i had to set it to 0.01 but now that's too much.
     
  43. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    308
    Would be nice if scattering would work with single pass rendering... just saying :)
     
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,864
    I had reported this issue and got an e-mail support response about changing the density, but that didn't work for me. Then suddenly it all seemed to work fine when I used it in another scene. I have no idea why one scene was different than another.

    I definitely agree with this. Even though I finally got it working, it ended up being too expensive to use and I took it out. It sure did look nice though.
     
  45. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,063
    Weird. I guess I'll play around with it in the hope it works.
     
  46. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    What kinds of trees are you using (shader)? Are they writing to the depth buffer? You should be able to verify that using the Unity frame debugger.

    I'm currently working with @olavrv to get this implemented.
     
    olavrv likes this.
  47. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    308
    When i enable SMAA in forward rendering mode, it breaks atmospheric scattering (Unity 5.4.3p4 & 5.5.1p3)

    Is there a quick fix for this? We are abandoning deferred rendering due to no good AA solutions for our needs... :(
     
  48. Porto881

    Porto881

    Joined:
    Jul 11, 2013
    Posts:
    74
    When will this work with U5.5?
     
  49. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    I'm looking into this together with the singlepass VR updates.

    If you send me your invoice ID I'll send you a link to download the latest internal version that's updated to 5.5 out of the box.
     
  50. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    This is my sunset scene .
    The Light color is correct
    but Scattering and Atmosphere color is incorrect .
    I don't know how to fix it .
    TODcolor.jpg
     
unityunity