Search Unity

Time of Day - Dynamic Sky Dome

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

  1. Jake-Morgan

    Jake-Morgan

    Joined:
    Mar 31, 2018
    Posts:
    7
    Does anyone know why lighting changes? Initially, it's dark, (7 am), all right, and then after a while, in the editor itself, it becomes lighter and remains so. How to fix this?
    Briefly, if you leave the computer for 5 minutes, the lighting will become brighter
     
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I never experienced that in the past, but I've not used ToD on a recent version of Unity.

    BTW, as a general rule, it's best to post what version of Unity you are using.
     
  3. Jake-Morgan

    Jake-Morgan

    Joined:
    Mar 31, 2018
    Posts:
    7
    Version Unity 5.6.4f1
    Necessary


    Result after baking

     
  4. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    What platform are you on / building for?

    Sounds and looks like you have Unity's global illumination bake enabled which doesn't really support dynamic lighting. Try disabling it in the lighting window.
     
  5. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    i hardly get 12 fps in adreno 506 xiaomi mobile :(
     
  6. grimcat

    grimcat

    Joined:
    Jul 12, 2013
    Posts:
    34
    I cam across your question while looking into this myself. In the TOD_Camera component you can offset the center on the Y axis to bring the horizon line down, or you can do what I did and edit Stars.shader on line 56 with the following change:

    old:
    Code (CSharp):
    1. half  alpha = saturate(i.tex.z) * spot;
    new:
    Code (CSharp):
    1. half  alpha = 1.0;
     
  7. mostlyhuman

    mostlyhuman

    Joined:
    Mar 16, 2013
    Posts:
    53
    Is there an intention to add support to Time of Day for the HDRP once the HDRP is out of beta?
     
  8. sean_virtualmarine

    sean_virtualmarine

    Joined:
    Dec 1, 2017
    Posts:
    11
    Win10/Win7 and 2017.4 (at the time) and now 2018.2
     
  9. SusannSympatient

    SusannSympatient

    Joined:
    Feb 2, 2018
    Posts:
    1
    Hi,
    will you by any chance update the shaders of your excellent Package also to the new scriptable renderpipeline?
    That would add so much value to my scene!
    Cheers!
    Susann
     
  10. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Interesting, must be hardware or driver dependent since we have thousands of people playing our games on Windows with 2018.1 and so far no reports of this happening. I'll take care of this in the next release. Until then, I suggest simply using something like max(0.01, dir.y) instead of zero.

    I will absolutely upgrade the package to take advantage of any new upcoming features as soon as we start using them in our games, but I can't give you an ETA yet.
     
    Willbkool_FPCS likes this.
  11. cwxxc3

    cwxxc3

    Joined:
    Feb 1, 2017
    Posts:
    23
    Hi. Big fan of this asset. Just one question, is there a way to get the night time be pitch black with stars showing? Right now I can only get it to the blue after messing with the settings.

    Was this asset used in rust around 2017? I really loved the look back in the XP/component system. A lot of nice blue tones and the scattering/fog was nice. Do you have any tips to get something similar
     
  12. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    You should be able to get a completely black night sky by adjusting the "Sky Color" gradient under the "Night" parameter section. This asset has been used in Rust since 2014. Please understand that I cannot share the exact configuration. I can however give you the hint that the "Sky Color" gradients are your friend when you want to tweak the sky tones. Also note that around sunset and sunrise the night sky color is blended with the day sky color, so it pays off to tweak both gradients when trying to get a specific look around sunset or sunrise. You can use the night sky color gradient to add an overall blue background tint to the sky when the sun is low.
     
  13. cwxxc3

    cwxxc3

    Joined:
    Feb 1, 2017
    Posts:
    23
    I understand completely. Thank you, that helped me get the look I wanted
     
  14. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    I have a question: I use a rather large world and set the player origin back to 0,0,0 at regular distances to avoid floating point issues. Everything works fine beside the fact that the clouds "jump" during that relocation of the world. How could that be avoided?
     
  15. dongchenwei

    dongchenwei

    Joined:
    Mar 9, 2015
    Posts:
    2
    @andererandre, hi ,big fan of TOD.

    now the latest version is using ray marching to shade sky color, there are some magic numbers in TOD_Sky.cs and the paper reference in the comment is removed, somehow get me a little confused:). Could you tell me which paper you refer to implement the sky shading, did you still use the [1]-[7] papers in the older version?
     
  16. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Hi all!
    Just bought this asset yesterday and I'm starting playing with it today.

    I'd like to grab a hand on the demo scene (https://andererandre.github.io/TOD/demo/) so I can explore how this particular scene is configured. Is it available to download? It would be very helpful.

    I've run a few searches in this forum but found nothing relevant.
    Thank you!
     
  17. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Well, I guessed that the Weather manager example script mostly covers this. Sorry and thanks!
     
    novion4 likes this.
  18. Kubic75

    Kubic75

    Joined:
    Jan 2, 2017
    Posts:
    83
    Still no news on SRP support?
     
  19. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    Ok, fixed that by altering TOD_Animation script and introducing a global position variable:
    Code (CSharp):
    1. public Vector3 OffsetUV
    2. {
    3.   get
    4.   {
    5.       var pos = _globalPosition * ( CameraMovement * 1e-4f );
    6.       var rot = Quaternion.Euler(0, -transform.rotation.eulerAngles.y, 0);
    7.       return rot * pos;
    8.   }
    9. }
    10.  
     
  20. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
    hi there,

    I just bought TOD and I am wondering why my runtime instantiated prefabs aren´t visible in the editor or build, but only in the hierarchy. As soon as I turn off the Sky Dome - Game object, my prefabs spawn just fine.

    Is there something I need to take care off?
     
  21. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Im super interested in asset, but before I take the plunge, I need to know if you can customize the visuals of the sky dome(texture)/clouds themselves? I'm assuming both are using some kind of default texture/map, can these be changed? I'm working on a stylized project and the realistic visuals of the clouds I see in the demos wouldn't work for us.

    I also noticed the sun/moon in some of the images provided, are these also customizable? (Primarily either the textures used for each or properties to alter their core appearance (scale/luminosity/colour). Cheers.
     
  22. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Hi -

    I had this same issue after just upgrading to 2018.2 and upgrading to Post Process v2. The issue can be reproduced with FXAA enabled - even with TOD_Rays in a prior position (SMAA and TXAA appear to work ok). Selecting "Keep Alpha" for FXAA resolved this issue.
     
  23. huyhuunguyen

    huyhuunguyen

    Joined:
    Feb 4, 2019
    Posts:
    2
    Hi all!

    I just bought the TOD. It seems like the TOD does not work on HDRP. I have tried many things but the outcome does not do well
     
  24. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
  25. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Are there any guidelines on how to actually incorporate fi the scattering in other shaders? Importing the cginc isn't doing much without actually incorporating it. Trying to incorporate within R.A.M (https://assetstore.unity.com/packages/tools/terrain/r-a-m-river-auto-material-101205) but can't seem to get things working.

    Edit: found this post (https://forum.unity.com/threads/time-of-day-dynamic-sky-dome.172763/page-36#post-3441811) but it seems RAM isn't using vertex and fragment driven shader. Any other suggestion?
     
    Last edited: Feb 18, 2019
  26. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
  27. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    Has anyone found tricks to get TOD_Scattering running efficiently on mobile? Even with all settings dropped to their lowest, scattering eats up about 20fps on my Android test devices.

    I expect I'll have to roll my own fog solution for mobile, but maybe there are some magic values I haven't tried...
     
    Salvador-Romero likes this.
  28. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I'm trying to follow these instructions but I can't find the ScreenToFrustumRay function.
    Any hint?
     
  29. Anti-Ded

    Anti-Ded

    Joined:
    Oct 21, 2017
    Posts:
    12
    Hello. i have this circle in the sky. What is this? It is not static and have only one way to see it (North-West)

    Sorry if this quastion was here. cant find it at 37 pages =(
     
    Last edited: Mar 8, 2019
  30. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    If it's always in the center of the screen then it's probably your skybox being clipped by the far camera plane. Check the TOD_Camera script on your camera, make sure "Dome Scale To Far Clip" is checked. If it already is, try reducing the Dome Scale Factor.
     
    hopeful likes this.
  31. Anti-Ded

    Anti-Ded

    Joined:
    Oct 21, 2017
    Posts:
    12
    TOD_Camera was not set =( Thanks a lot =)
     
    hopeful likes this.
  32. denissulyagin

    denissulyagin

    Joined:
    Jul 9, 2015
    Posts:
    2
    Will there be support for SRP HDRP?
     
    Matthu32 and EricSterner like this.
  33. Matthu32

    Matthu32

    Joined:
    Mar 5, 2019
    Posts:
    4
    I was gonna ask the same thing about LWRP

    Also, will this be upgrade for Unity 2019?
     
  34. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Increase the "Far" parameter under the clipping plane option of your camera.
     
  35. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    6 month since last entry from André :(
     
  36. vinnygombici

    vinnygombici

    Joined:
    Dec 16, 2015
    Posts:
    25
    Hello, does this plug in works with HDRP?
     
  37. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Here is a screenshot from our game, Scions of Chaos: Prologue, that uses Time of Day with atmospheric scattering.

     
    Mark_01 and hopeful like this.
  38. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    92
    Brilliant plugin. I like how easily your code allows creation of sunset lighting while casting shadows...!

    How would one override stars to have them appear in a lighter sky (that is, have stars appear earlier than they would in the accurate simulation)?
    The intention is to have stars over an early-evening blue sky, as if one had taken a photograph by moonlight.

    I like the sunset illumination (sun's position) at 1.4 UTC, but also want stars in the sky as at -4.8 UTC for example.
    Lat: -55
    Lon: 39
     
    Last edited: Jun 6, 2019
  39. huyhuunguyen

    huyhuunguyen

    Joined:
    Feb 4, 2019
    Posts:
    2
    Hi guys,
    Is there a way to add more moon mesh into the skydome?
     
  40. alpdogan

    alpdogan

    Joined:
    May 8, 2015
    Posts:
    10
    Hello,
    I'm having a problem with WebGL build, there are patches of dark mesh when I rotate the camera.
    Can you direct me to the solution?
    (Only happens on WebGL)

     
  41. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    If you mean make the moon bigger, under the TOD_Sky script controls you can change Moon/Mesh Size.

    If you want ADDITIONAL moons, you could duplicate the existing moon in the Sky Dome instance, then scale it and give it its own texture.

    However, Time of Day obviously has no idea what kind of rotation cycle that moon should be on, so you could either make it a child of the "real" moon (so the two moons will move together) or you would have to add your own script to drive your extra moon's position/rotation based on TOD_Sky.Cycle.Hour.
     
  42. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    I found two places where you would have to modify some code to make that work:
    TOD_Sky+Settings.cs, line 266, and TOD_Sky.cs, line 435.
    Both of those lines use the formula "(1-Atmosphere.Fogginess) * (1-LerpValue)" to determine star brightness and whether they should be rendered, respectively.

    If you modify that formula in both places (e.g. replace "LerpValue" with "(LerpValue * 0.9f)"), you should be able to make your stars come out earlier (and stay visible longer in the morning).

    -Scott
     
    hopeful likes this.
  43. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    Looks like z-fighting; I would try decreasing the "Dome Scale Factor" on the TOD_Camera script on your camera.

    -Scott
     
    Salvador-Romero likes this.
  44. fatality674

    fatality674

    Joined:
    Nov 1, 2012
    Posts:
    24
    Is there any way of getting atmospheric scattering to work with AA?

    Unity seems to hang whenever i try to add the atmospheric scattering component to the camera, we already have a sizeable post processing stack set up which has AA so thats definitely the cause. I don't really want to sacrifice AA for scattering but the sky looks so much better with it.
     
  45. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Have you tried playing with sky color parameters at night? In TOD_Sky.
     
  46. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Hi!
    Anyone of you have had any troubles upgrading to 2019.1? I have recently upgraded my project from 2018.1 and the sky colors (greener), sun aura (wider), etc are all kind of messed up.

    Thanks!
     
  47. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    Answering myself: I have made new projects in both 2018.1 and 1019.1 and see no meaningful difference. I forked then my original project and upgraded to 2019.1 again, and this time observe no different whatsoever.

    Not really sure what happened, but false alarm.
     
    hopeful likes this.
  48. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Hello,

    I am strongly considering purchasing this asset, but I have two major questions.

    Firstly, does the asset work in 2019.1?

    Secondly, does the asset work, or can it be made to work, with an arbitrary up vector for the player?

    I am working on a space sim where players can land on planets, so the up vector for the scene is not always along the y-axis. All of the other Time of Day solutions that I have looked into don't support this, what about this asset?
     
  49. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    54
    1.- I made some quick tests and it seems to work. However, sometime I got some estrange glitches with colors, I believe when changing platforms. But switching back and fort or reimporting have solved it. I honestly didn't figure out what was going on.
    2.- The asset works around an object called Sky_Dome. I have tried rotating it and it seems to work. However, I am seeing some strange artifacts that does not seems to affect the assets:
     
  50. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Thank you very much for your reply!

    Do you happen to know if it is possible to fade in/out the asset? So that I can move from a space scene to a ground or surface scene?

    Also, is it possible to customise the background of the night sky? So that I could have a nebula, etc, instead of the existing fixed starfield?