Search Unity

Time of Day - Dynamic Sky Dome

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

  1. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    1. I don't think so. The asset controls Unity's skybox settings and other Lightning parameters, plus controls some lights. It's kind a global thing, not just a sphere that you can make it more transparent, for example. Also, the clouds are not something 'reachable' or volumetric. I.e.: you cannot flight through them.
    2. There are some 'space' configuration, that I think is for showing the milky way at night, but the stars are calculated, actually. You have to give the asset a date and a latitude, and the asset calculates the position of stars and planets. The asset is focused on realism. I'm using it in an architecture visualization system, for example. TOD is actually great for such kind of applications, but I don't think I would use for a No Man's Sky type of game at all, unless every planet would be a different scene that you can load (instead of approaching and landing). In the latter case, the asset has plenty of options to manipulate atmosphere, lights and colors, so you can easily build an alien environment.

    Bear in mind that I am not the author, just a new user, and that I'm in a hurry because I am leaving for vacations :D
     
  2. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    Damn, I answered and then I deleted the post accidentally. Back to rewrite the answer:

    1. I don’t think so. The asset controls many Unity’s lighting configurations, like the skybox, plus some lights. It is something kind of global, not just a sphere that you can make more or less transparent. Also, clouds are not volumetric, and are not designed to be reachable.

    2. Stars and planets with TOD are calculated. You enter a date, time and latitude and they are positioned on the sky realistically. I am using it for an architecture visualization project, for example, and it’s really great for that, but I wouldn’t use it for a No Man’s Sky type of game. Unless every planet you visit is a new scene that you can load, or hide the enabling and disabling of the asset to the player in a clever way. In this case, the asset has plenty of options to configure atmosphere and lights, so you can easily configure an alien planet landscape… But with boots on the ground.

    Bear in mind that I am not the author, just a new user, and that I am in a hurry, packing for vacations :)
     
  3. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    171
    Hey, thanks again for your reply!

    I realise the clouds aren't reachable, I will have to find some other solution for that, that's not an issue.

    Would it be possible to configure the atmosphere to provide a nebula like effect? Or are the star positions and skybox fixed?

    I can work on some way of hiding the transition (something like a re-entry burn effect, etc) as long as the actual night skybox can be customised. In the demos it seems to be a fixed image of stars, etc?

    I realise that you're not the author, I'm very grateful for your input, enjoy your vacation!
     
  4. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    Hi,
    TOD controls many parameters of the lightning window. Those parameters fall beyond your control while using TOD. Among them is the Skybox. The Skybox will be configured to use a skybox material by TOD (image 1), and this material will be updated on real time to replicate the colors you have selected for Day and Night in TOD (image 2).

    Apart from that, TOD also uses a spherical objects to render clouds and stars. As I said, stars are calculated, depending on the UTC time and latitude you enter to TOD, and then are rendered on those spheres on real time and realistically (as they appear under those conditions) (image 3).

    See images here.

    Perhaps you can render your nebulae in a sphere in this fashion. Also, there is an object, disabled by default, in the TOD system called ‘space’, that you may tweak for your convenience.

    Perhaps studying the documentation will give you more clues. See what's written there:

    "Q: How can I render a cubemap or custom skybox at night?
    • Make sure the "Space" child object is enabled.
    • Assign your cubemap to the "Space" material and adjust the brightness parameter."
    Cheers!
     
  5. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    171
    Thank you, that's very helpeful.

    That does seem like a good idea. I could generate a cubemap, and apply it to the TOD skybox dynamically? That was my idea, actually.
     
  6. ZackNewworldcoders

    ZackNewworldcoders

    Joined:
    Jul 19, 2016
    Posts:
    10
    Hi There, i have looked almost everywhere, and a lot of screenshots and i cannot deffinitvly find out...

    Does this Asset support HDRP (High Definition Rendering Pipeline) im looking for a solution that does...
     
  7. vhouston214

    vhouston214

    Joined:
    Aug 30, 2019
    Posts:
    1
    So I've encountered only one bug so far. It's a very impressive asset but for some reason, from certain angles a void will appear in the cloud layer and it shrinks and grows depending on what angle you're looking at.
     
  8. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    Can you post a screenshot?
     
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,722
    This happens if you forget to attach the TOD_Camera script to your camera.
     
  10. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,138
    Does anyone know a skysystem that works with HDRP?
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,722
    I'm pretty sure that there aren't any yet.
     
  12. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    I am having troubles using the post processing stack and Android. Every time I switch to Android, colors seem to be way off. I decided to try with a new project. I included TOD barebones and checked in several platforms. It seems to be the same in all platforms. But when I include the post processing stack (just color grading), Android goes bananas.

    post processing Android.png

    In other to discard that there is something with post processing, I have created a new scene, with no TOD. With no postprocessing, the scene looks the same in all platform. After adding post processing, the scene looks the same in all platform as well, so no problem. Adding TOD then introduces something that make the scene looks weird, but only on Android.

    I reckon there is something with TOD, post processing and Android.

    I've been looking in the forum to no avail. I'm using 2018.1. Anyone has any clue? Thank you!
     
  13. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    Is the sunrise time obtained local time or UTC time?Thank you!
     
  14. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    You can specify the lat/long position with TODSky.World.Latitude and TODSky.World.Longitude, and sun times will then be based on that location. You can also set the UTC offset with TODSky.World.UTC.

    If you don't specify, I'm not sure what it uses for default. System values, probably?
     
  15. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    I am in Jiuquan, China. I set the longitude and latitude of Jiuquan and UTC. When the sun sets, the panel shows the time at 14 p.m. Why?Thank you
    微信截图_20191014105527.png

    微信截图_20191014105537.png
     
  16. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    Just a guess, but could it be because your "Day Length in Minutes" is so short? Try increasing that to at least 1.0 and see if that makes any difference.
     
    Salvador-Romero likes this.
  17. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    OK, so I wrote an email to André and he suggested me the solution.

    I had my camera with HDR enabled, and in TOD_sky I’ve selected HDR in Color Range. Or Auto, I don’t remember. It didn’t work with either of them. But when I selected LDR, it suddenly works (in LDR, but with proper colors).

    How’s that possible, if I am working with linear and HDR just fine in all platforms? Well, the answer turns out to be that Unity disable HDR on Android by default. This is clearer in Unity 2019 than in 2018, but long history short: If you go to graphic (Edit -> Project Settings -> Graphic) you can see that HDR is disabled for all 3 tiers on Android. If you unckeck “Use defaults”, you can then activate HDR. Only then, selecting HDR for TOD works.

    Tweaking those settings, I have managed to make it work with LDR in all my Android devices, and HDR in some of them. I have an old device where, if HDR is selected, the sun turns blue on sunsets ¯\_(ツ)_/¯. But at least I’m no longer stuck. Thanks to André and Scott for the support!
     
    hopeful likes this.
  18. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    Hello,I’m using Day Length In Minutes,value is 0.1.At night,It took a while for the cube to darken.why?Thank you for your help
    NeoImage_副本.jpg
     
  19. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    Ambient light levels aren't updated every frame (for performance reasons, I assume), so at a very fast time cycle you will see the ambient light pop as it tries to keep up.
    To fix it, in the TOD_Sky script scroll down to the "Ambient" section and decrease the "Update Interval". If you're seeing the same problem with reflective surfaces, you can do the same thing under "Reflection".

    -Scott
     
  20. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    Hello, I have a rectangular terrain in my scene. How can I make the edge of terrain connect with sky of time of day?Thank you!

    微信截图_20191024084906.png
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,009
    I'm not entirely sure what you mean, but a relatively easy way to have a large horizon is to place a much larger low resolution terrain mesh under your smaller detailed terrain mesh.
     
  22. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    Do what hopeful said to get your terrain to look like it reaches to the horizon. Then, if you want to to blend smoothly with the skydome, enable fog and set the fog color to match the skydome's horizon color.
     
    Salvador-Romero likes this.
  23. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    Besides what Hopeful and PanicEnsues say, which is the way to go (don't forget to lower terrain resolution, specially for lightmapping), adding some hills or a curve in the edge is another trick that's helpful.
     
  24. grm22

    grm22

    Joined:
    Nov 6, 2019
    Posts:
    4
    Hi,
    I need to change the Sky Dome size at runtime.

    I found two ways: enable the "Dome Scale To Far Clip" option and change just the far clip plane of the camera, or leave the check disabled and update both sky dome scale and camera far clip plane separately. Unfortunately both of them does not work properly.

    If I enable the "Dome Scale To Far Clip" flag, then there is a problem because the sky dome size will be exactly the same as the far clip plane of the camera and a little black hole appears in the sky (not always visible, but rotating the camera it appears). So, is there a bug or nobody found this error yet?
    1.png

    On the other side if I update the camera far plane at runtime for example from 3000 to 4000 and the sky dome scale from 2900 to 3900 then I see something like the following image.
    2.png

    It seems that something is not updated correctly. Accidentally I found that black ball disappears clicking on "physical camera" checkbox of my main camera.
    Any idea?
     
  25. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    Try setting the "Dome Scale Factor" (on TOD_Camera) to 0.95.
     
    Salvador-Romero and hopeful like this.
  26. cwxxc3

    cwxxc3

    Joined:
    Feb 1, 2017
    Posts:
    22
    Will this ever be updated for HDRP? I don't see any asset on the store that has time of day working for HDRP. I saw that you were updating it when rust goes to HDRP, is that still planned for December?
     
    Cascho01 likes this.
  27. grm22

    grm22

    Joined:
    Nov 6, 2019
    Posts:
    4
    Done as suggested: set "Dome scale factor" to 0.95.Then, from a script, at runtime I set Camera far clip plane to a greater value wrt its original value. I can see the sky dome scale accordingly increased but unfortunately the big black ball is still there.
     
  28. grm22

    grm22

    Joined:
    Nov 6, 2019
    Posts:
    4
    It seems that camera.ResetProjectionMatrix() solves the case.
    In Unity doc I found "If you change this matrix, the camera no longer updates its rendering based on its fieldOfView. This lasts until you call ResetProjectionMatrix.". But nothing about far clip plane. So is there a lack of documentation?
     
    hopeful and Salvador-Romero like this.
  29. grm22

    grm22

    Joined:
    Nov 6, 2019
    Posts:
    4
    Why the Sky Dome bounding box is not a cube? Example: Extents (4798.7, 4785.0, 3877.3).
     
  30. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,138
    Also have a (small) black hole at the bottom of the sphere-mesh.
    Have TOD_Camera.cs on camera.
    Set scale to 0.95 and so on.
    Hole remains.
    Far clipping plane is beyond as you can see:

     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,009
    What Unity version are you using?

    Also, for a solution see a couple posts above.
     
  32. YohanB

    YohanB

    Joined:
    Jun 9, 2015
    Posts:
    9
    The package does not have any sample, not everyone has the time to go through documentation and try things till it work. Can you add or provide some example in the project?
     
  33. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    A clipping hole would only be visible from the camera itself, not externally from the scene camera. That looks suspiciously like black geometry sitting at the bottom of the sphere.
     
  34. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,138
    Exactly!

    There´s definitively no additional geometry, it´s the last polygons of the sphere that render black.
     
  35. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,722
    I checked my scene and there is a strange pentagon shaped artifact at the bottom inside of the sphere. That's probably what you are seeing. However, this would never show in the scene anyway so I don't think you need worry about it.
     
  36. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,138
    I do see it in the gameview.....
     
  37. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,722
    How? When the scene runs the bottom of the sphere will be underneath the terrain. Unless you don't have any terrain.
     
  38. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    I tried running my current project on an old toaster laptop with no discrete GPU. When I run a scene with the exact same Time of Day settings I'm getting a very different sky color:

    SkyColorMismatch.jpg

    Color space is Gamma, Color Range is LDR. Fog and Scattering are off. All identical TOD_Sky settings.

    All other scene colors (water, models, etc.) match, just the sky is different.

    Does anyone have any idea what might cause this mismatch? I don't know if it's related to the different GPU, or if there's some other "Auto" setting somewhere that I'm missing...

    -Scott
     
  39. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,138
    Exactly...
     
  40. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    230
    Very nice asset, does it support an arbitrary number of celestial bodies? Or only 1 sun and 1 moon?
    Can it also have a storm incoming? Or you have to have the whole of the clouds be on one state or another?
     
  41. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    230
    Actually, an even easier question, how do I make the clouds move? I can't seem to find anywhere how to make them move, I can make them cover more or less make them higher or lower, etc, but I can't make them move as time passes
     
  42. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,722
    There is a wind speed setting somewhere I believe.
     
    Guedez likes this.
  43. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    230
    Oh, thanks, I assumed that was for tree wind for some reason
     
    magique likes this.
  44. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    You can change the state of the clouds and it will change smoothly. There is a script in the package, "TOD_Weather Manager", that you can add to the Sky Dome object, and with which you can start playing with the cloud coverage easily.
     
    Guedez likes this.
  45. Salvador-Romero

    Salvador-Romero

    Joined:
    Jan 21, 2014
    Posts:
    28
    Are you sure you selected LDR in TOD_Sky, not auto? Beware with the "autos", they don't always work.

    Intel HD 3000 is from 2011, if I am not mistaken. I read that it supports Directx 11 (and I didn't expect that), but anyway I am leaning to think that there must be something related with that. Perhaps using an older Unity version or setting it up to work with Directx 9 will do the trick.

    It is worth it, anyway? :) I still have a barebone PC with an Intel 3000 connected to my TV, but I am not using it to play games anymore, except retro games.

    And that was me trying to be helpful. Cheers!
     
  46. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    I definitely changed the two "Auto" options (Color Space and Color Range) that I found to Gamma and LDR. There may be other Auto options I haven't found yet.

    Specifically supporting the HD3000 chipset isn't a big deal, I'm more concerned about what other hardware (that I can't specifically test on) is going to have the same problem.
     
  47. ffertigo

    ffertigo

    Joined:
    May 31, 2015
    Posts:
    12
    Hi, could you help me to edit the star skybox to be a full 360° skybox? the Stars can be static, but it shouldn't be a half globe, like it is now. Thanks
     
    Last edited: Dec 6, 2019
  48. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    86
    I think the stars actually do render in a full sphere; however, the atmospheric effects that start just above the horizon obscure the stars below that level.
    If you want an environment that is just stars and no atmosphere (e.g. you're making a space game), this is probably not the right asset to use.
     
  49. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    Hello, I want to change the Light Color parameter through code. How can I do this? Thank you
    微信截图_20191209100354.png
     
  50. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    20
    My ground color is yellow. When I change the Light Color color to white, the ground color is normal. But it seems like I shouldn't adjust the Light Color. What should I do to make the ground color look normal? (The ground should be white?)
    微信截图_20191209103402.png 微信截图_20191209103501.png
     
unityunity