Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Time of Day - Dynamic Sky Dome

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

  1. msgamedev

    msgamedev

    Joined:
    Dec 24, 2011
    Posts:
    427
    Yeah sure, the baked shadows will stay in place,

    but its important if the sun acts as a moving directional light that can cast real time shadows, so at least the shadows that are rendered in real time around the camera (=Player character) are displayed correct.

    Its simply a performance issue. Its impossible to use real time shadows from a moving lightsource in an outdoor scene, and it looks ugly if the shadow distance is too near.

    so does the sun cast shadows and if so, can they be turned off?

    Or let me put it in another way:

    I use a directional light in the scene and bake a lightmap. Then i turn off the shadow casting on the moving sun, so all lightning still comes from the directional light. I#m aware that at some point the shadow casting wont match with the position of the sun.
    Another thing: can a lens flare effect be used on the sun?
     
    Last edited: Aug 17, 2013
  2. Chadivision

    Chadivision

    Joined:
    Nov 10, 2012
    Posts:
    7
    Sorry if I've missed something elsewhere that states this, but does this require Unity Pro, or will it work in free? I'm interested in desktop and mobile. Thanks.
     
  3. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Absolutely, you can disable the shadow casting of the directional lights of the sun and moon and use your static lightmaps in that case.

    You can add a lens flare effect to the sun. However, you might be aware that lens flares are not being occluded by semi-transparent objects as those don't write to the depth buffer, which is also true for the cloud layer. This probably won't even stand out in most scenes, but if you set the cloud layer to overcast and the weather to storm such that the sun should be covered and therefore invisible from the ground it's probably a good idea to disable the lens flare.

    An alternative that's being used in a lot of modern games is to use HDR rendering and a bloom post-process effect that only applies to those areas where the sun is really bright. Those image effects are included in the Unity Standard Assets and work quite nicely.

    It works with both Indie and Pro, as stated in the package description.
     
  4. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Hello, just bought it :)

    I've not tested it yet, but I noticed in the WebPlayer demo that when the sky is covered of clouds (and especially when Storm is selected) the brightness of the ground doesn't change at all. Is it something that I could change easily? Do you plan to automate the variation of the light intensity when the sun is covered by clouds?
    It would be great to have clouds shadows too :p

    Thank you,
    Maurizio
     
  5. shwa

    shwa

    Joined:
    Apr 9, 2012
    Posts:
    447
    -The filesize overhead is in fact quite low as most things are being calculated on the fly in the shaders. The .unity3d file of a web player with just the sky dome and 4 default cubes in it is 237KB in size.

    237kb?

    Nice!

    Just bought the kit, in part cause of the super small filesize.

    - The package does not contain any particle effects at the moment.

    Any plans for that?

    If i bring in my own particle effects, is there code to trigger them?
     
  6. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,393
    re: Dynamic weather manager

    does it do wind, rain, snow, sleet, fog, lightening, frost, etc.

    or is it just day and night, moon, sun, clouds.

    how many layers of clouds? can have multiple independent layers of different clouds moving in different directions doing different things without coding it yourself?
     
  7. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    I'd like to know this as well. I played the demo and selected storm, but all that happened is the clouds came in.
     
  8. TracyRenee

    TracyRenee

    Joined:
    Jul 11, 2013
    Posts:
    2
    Hidee ho :)

    Just got this today :) IT ROCKS ... BUT ... only the provided demo's seem to be working properly (and they're gorgeous btw) ... but, adding the dome into my existing scene, no matter what I do to make ALL settings between camera control scripts and dome scripts be identical to those in the island demo provided, my sky looks like the pic below and that orb is part of the camera, it moves where i look. but all my settings are identical to the demo provided. What have i missed?

    $TimeOfDay100.jpg

    Thanks tons for all your help!
     
  9. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Darkening the sunlight intensity for the storm weather is a minor change in the weather manager and I'll include it in the next update.

    However, doing it for the clouds that travel in front of the sun and occlude it will probably not get in there. While I agree that this would look really cool, doing it sounds rather expensive to calculate. It would probably require some fairly expensive image operations if it's supposed to look any good (sample all parts of the sun and check if they're occluded by clouds) and that's probably the reason that no games I know of have this. However, doing it based on the selected weather type is not an issue and will be in the next release.

    While I'd love add cloud shadows, this would probably mean that you need to replace all shaders in your project with specially modified ones or use the rather expensive projector that comes with Unity. Both of which I don't want to use, especially since the former would make my package incompatible with packages like Unity Shinsine.

    I might research this a little further and see if there is another way of doing this.

    When I asked about this a few weeks ago in this thread most people seemed to think that I should keep Time of Day focused on the sky dome part and not include particle effects at all. Some said I should release it as an optional addon instead. For the time being no ETA though.

    Enabling / disabling your own particle effects would be quite easy. You have access to the day of the year, time of day, weather type and pretty much everything else. If I were you I'd just check those parameters in a custom script and go from there.

    The cloud layers in Time of Day work a little different from what you might have seen so far. I sample the texture in the cloud shader twice, move both UV coordinates, blend the two together and apply normal-map based shading. That way the shape of the clouds changes as time progresses and it doesn't just look like a flat layer.

    While it's theoretically possible to just copy paste the cloud child game object a few times that's nothing I've done so far and you shouldn't really have to do it to get some nice clouds. If you test the package in your project, don't like the clouds and insist on being able to do this I'll look into it and streamline the process in the next update. However, please have a look at it as it is first.

    Definitely a clipping plane issue. Set the sky dome scale to your camera far clip plane distance (possibly minus some offset if you experience z-fighting). Also make sure to read through the readme, things like that are explained in there.
     
  10. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    Am I able to change the ambience lighting in the day-night cycle? I want the ambient light to be brighter in the day, but dark at night.
     
  11. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    It's not in there at the time being, but I already got a request to do this from someone else and it will be part of the next update.
     
  12. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    I'm doing some test within Big Environment Pack. It looks great. But I have a coupe of problems (I'm on Unity Inde 4.2):

    1. During the night there are no stars at all (tried an empty scene too).
    FIXED. I hat to set the tiling of the stars to 1 instead of 3. My question is now, it's only me to have this problem? In this case, could it be that some players could have different result?

    2. At specific time of day (5 and 18.2) I have some big black "holes" that grow and reduce changing the time:
    $Screen Shot 2013-08-18 at 7.32.24 PM.png
    FIXED. Lightmap doesn't play well together ToD. Anyway It has no meaning to use it with ToD. Sorry, my bad.

    3. A common skybox with sun look like this:
    $Screen Shot 2013-08-18 at 8.03.18 PM.png
    but with ToD i have:
    $Screen Shot 2013-08-18 at 8.07.02 PM.png
    This is very nice but I'd like to customise the amount of light "spreading" (sorry don't know the correct term). I tried many parameters but no luck.

    Thanks
     
    Last edited: Aug 18, 2013
  13. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    I see your deal-of-the-day got us many newcomers! Good stuff congrats.. But yeah Time of Day shouldn't strive to become yet-another-particle-system I think. Do one thing best, rather than 101 things less-than-best.

    I for one know how to change my ambient light from scripting code -- if time of day keeps adding more "magic" like this, we need toggleable options for all that magic too. I'm happy with the auto-fog (next update will see this refined, I hope :D ) and would quite appreciate similar "reasonable suggestions" from ToD, but they should be toggleable (similar to or included with the current sky time sky weather scripts).

    Before any of all these fancy new suggestions, I'm still hoping for earth-shadow-in-atmo and lower-poly icospheres anyway though ;) :D

    I'd be very interested in this too! A round sunlight ball would be preferable, I agree --- as long as we don't go back to the "sun mesh" we had before. I was glad that ToD successfully got rid of it.
     
  14. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,393
    so long as it's reasonably priced a full weather effects as a companion addon is ok.
     
  15. TracyRenee

    TracyRenee

    Joined:
    Jul 11, 2013
    Posts:
    2
    YOU ROCK! Got it :) my overall terrain was 2000 but i had made the dome be 1500 so i wouldn't see my water edges, had to make the far clip actually be 2500 and it went away. Thanks tons!!!
     
  16. Krazeecain

    Krazeecain

    Joined:
    Apr 2, 2013
    Posts:
    7
    I think I found a glitch? When I add one of the sky domes (high, low, or medium) Unity constantly seems to think that changes were made, and I need to save. Even right after saving, the asterisk is still there, and will ask if I want to save again if I try to open a different scene, or close Unity. I guess this isn't a big deal, but I'm worried it might mess with something important. Do you know what might cause this?
     
  17. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    I always have this with Unity, whether using Time of Day or not...
     
  18. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Loving all the activity in this thread since the sale! Let's hope I can do all your questions justice. It also looks like quite a few of you are from the US, so don't be irritated by the fact that I answer your questions when it's the middle of the night in your time zone. :)

    Yes, that was the result of the customer survey and it will stay that way. A companion addon might become a thing one day, but Time of Day should be a great sky dome, and that's what it is.

    I will make both automatic fog and ambient light toggleable.

    Earth shadow may or may not be part of the next update (still have to look at the science and see how complex this would be to implement), lower poly icospheres will definitely be.

    "Directionality" is the parameter that adjusts the sun size, is that what you meant? Technically speaking the sun would only be as big as the moon, but out eyes can't handle it and the flares blows the size up quite a bit if you try to look at it. If you look at games that try to model our planet realistically (like ARMA 3) you'll see that their sun looks quite similar to the one Time of Day has.

    ARMA 3 goes a little further and makes the sun blind you using bloom (feel free to add that, it's in the Unity Standard Assets - I recommend using it together with HDR) and reflections on their scopes which they dynamically enable and disable, which can hugely influence complete firefights. They also use lens flares when you're in 3rd person (it doesn't make a lot of sense in 1st person, our eyes don't create lens flares) and a glare both in 1st and 3rd person (basically the same thing as a lens flare, just a bright spot that's being added to the image and brightens almost the complete image if you look at it - you can do the same using the curves image effects if you don't want to manage lens falres).

    This in fact depends on the screen resolution. If your editor window is very small a star will simply be so somall that it doesn't even partially fill a pixel. While mip mapping reduces this effect and prevents the stars from flickering, this has always been an issue in PC games. Try executing in fullscreen (as most players will) and you'll see the stars even with tiling 3.

    Lightmaps work if you bake them from another directional light and disable shadow casting for the sun and moon lights. A lightmap for a moving light just doesn't make any sense as you correctly found out.

    Yep, this occurs as soon as you have a script that's being executed in the editor and changes some material parameters. I thought about why this happens and it might be an option to check if a parameter changed before sending it to the material. However, since this would be some serious overhead It would have to be executed only in the editor.

    You don't have to fear that anything is being damaged by this, it's just that Time of Day applies changes you made to the parameters in every frame and Unity thinks something changed because of that.
     
    Last edited: Aug 19, 2013
  19. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Directionality reduce the size but doesn't create a round sun. If you reduce it too much the sun disappear, or you can see the triangles of the dome.
    Instead I found a great simple solution. I added a quad as child of the sun and used a "Particle/Additive" shader with the default-particle texture. Here the results:
    $Screen Shot 2013-08-19 at 8.14.47 PM.png
    $Screen Shot 2013-08-19 at 8.16.39 PM.png

    I tried both on small resolution and on very large one. The tiling 3 doesn't display stars to me. I'll do more test on more devices and resolutions.

    One more thing about the moon. I feel it was too dark, so I changed the texture and brightened the halo. The problem now is that the halo is always circular in any moon phase. Probably we should have a glow effect only on the visible part of the moon, but I don't know if is possible with the Indie version. Any suggestion on this?
    $Screen Shot 2013-08-19 at 8.46.37 PM.png

    Thanks
     
  20. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Great hack and looks gorgeous!! I cast my vote for this additive-particle-quad to make it into the standard prefabs.. who's with me? :cool:
     
  21. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Wow, that's what I call a great community! I like the result a lot, I'll look into this and might include by default. I actually tossed around the idea to make a plane with a sun texture and render it in an additive pass ever since metaleap suggested it, but I honestly didn't expect it to look that good.

    That's the first time I heard that and I cannot reproduce it on my screens. However, my display has a rather high pixel density (2560x1440 at 27"), can someone with a normal HD display confirm this? If that is a commion issue it might be a good idea to reduce the tiling to 2 or even 1 by default.

    It would be possible to add that to the moon shader. The halo wasn't really meant to glow that much, but if people decide to use it that way anyhow it might be feasible to include.
     
  22. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Fwiw, I never saw the stars in the night sky while playing with ToD ever.. but my resolutions never exceeded 1920x1080.

    Another thing to consider for this is retina-scale resolutions or the higher DPI found in current-gen mobile devices. Even if you get pixel-perfect stars, ie. with individual stars ending up at 1x1 on-screen, they will be invisible or look like pixel errors at best if the user has good eyes and holds the device close to their face. And on such devices would we really use some 2048px texture just for some white dots on a black backdrop? Probably would go for a rather "artsy" (with some spacey milkyway-ish star clouds) pre-made tiling night sky texture of around 512px or so. Would be good for ToD to test for scenarios like that, last I played with such a setup it looked rather weird so I just reverted night sky to a black-only 16px texture for the time being.

    For moon glow: in my case at some point I'll hack up a fast postfx shader for "general glow" probably based on the current "mobile glow" shader in the asset store. For projects that only need the moon to glow and nothing else, it might be useful for ToD to provide a glowing appearance, but like the halo make that optional ;) in my case I'll have it glow via the same parameters that will also have lanterns, torches and perhaps even night-sky stars glow..
     
  23. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    The only problem that I have now is that the quad is rendered over the clouds too, and I don't know how to fix this.
    Any idea?
    Thanks
     
  24. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    I didn't mean to add a glow shader, but I may modify the moon halo shader to handle partial occlusions even when configured to be very bright.

    By the way, the icosphere for the "Low" prefab is now at 320 tris on my developer branch and everything's working quite nicely.

    That's the rendering order because you use a shader that is usually being rendered after the skybox (for obvious reasons). The sun has to be rendered at "Transparent-410", you can use this simple shader I just wrote:

    Code (csharp):
    1. Shader "Time of Day/Sun"
    2. {
    3.     Properties
    4.     {
    5.         _MainTex    ("Base (RGB)", 2D) = "white" {}
    6.         _Multiplier ("Multiplier", float) = 2
    7.     }
    8.  
    9.     SubShader
    10.     {
    11.         Tags
    12.         {
    13.             "Queue"="Transparent-410"
    14.             "RenderType"="Transparent"
    15.             "IgnoreProjector"="True"
    16.         }
    17.  
    18.         Fog
    19.         {
    20.             Mode Off
    21.         }
    22.  
    23.         Pass
    24.         {
    25.             Cull Back
    26.             ZWrite Off
    27.             ZTest LEqual
    28.             Blend SrcAlpha One
    29.  
    30.             CGPROGRAM
    31.             #pragma vertex vert
    32.             #pragma fragment frag
    33.             #include "UnityCG.cginc"
    34.  
    35.             sampler2D _MainTex;
    36.             float4 _MainTex_ST;
    37.             float _Multiplier;
    38.  
    39.             struct v2f {
    40.                 float4 position   : POSITION;
    41.                 float2 uv_MainTex : TEXCOORD0;
    42.             };
    43.  
    44.             v2f vert(appdata_base v) {
    45.                 v2f o;
    46.  
    47.                 o.position   = mul(UNITY_MATRIX_MVP, v.vertex);
    48.                 o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
    49.  
    50.                 return o;
    51.             }
    52.  
    53.             fixed4 frag(v2f i) : COLOR {
    54.                 return _Multiplier * tex2D(_MainTex, i.uv_MainTex);
    55.             }
    56.  
    57.             ENDCG
    58.         }
    59.     }
    60.  
    61.     Fallback "None"
    62. }
    63.  
    It will be in the next release together with some additional sun-related tweaks.
     
    Last edited: Aug 21, 2013
  25. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Wow! Thank you!
    I'm still studying the shaders and I'm having hard time to find a good documentation.

    Anyway I was able to simulate the cloud shadows using a custom projector shader so to scroll and scale the uv. I'm quite satisfied of the result, but is not in sync with the clouds on the sky. So if the player is obscured from a projected cloud and looks to the sun, could easily happen that the sun is not covered at all. So until the sun is out of the view the effect is quite good.
    The other limitation is that I'm using a static texture for the projector, so it's hard to simulate a dynamic weather. Would be great to have a texture generated procedurally.
     
  26. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Well the ToD, at least in the "low" setup, is just scrolling through 2 cloud textures, maybe there might be a way for ToD to expose the "current scrolling uv" for custom scripts to pick up (and then apply them to your own projector material or some such)...
     
  27. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    It could be an option, but still there are other factor, like wind speed and direction that are not easy to align to projector math.
     
  28. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    The cloud UVs are being calculated in the cloud vertex shaders. The cloud shape is being modified in the fragment shader using the input texture and the sharpness parameter. Furthermore, the cloud fragment shader samples the input texture at two different UV coordinates and blends the results, which provides that feel that clouds dissolve and appear dynamically. What I just said applies to the "High" and "Medium" quality setting, the "Low" is really just a plain texture at the moment, yesterday I added calculations to apply the sharpness parameter in a simplified way and at least some sort of basic shading that works really well even on the lowest end mobile devices:

    $Screen Shot 2013-08-21 at 13.18.02.png

    The problem with procedural textures that are being generated on the CPU, uploaded to the GPU and used directly in the shader without modifying it any further is that they have to be updated every frame the cloud conditions change or at least quite frequently. That's quite a bit of overhead for the CPU.
     
    Last edited: Aug 21, 2013
  29. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Wow, totally looking forward to the next update with all these improvements for "low-fi" mobile apps. Really appreciate your attention to this a great deal! As you keep this up, I'm quite sure ToD is well on its way to becoming the de-facto go-to solution for pretty-but-fast, plausible real-time skies in Unity for years to come.
     
  30. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    I understand that some operations are quite heavy (as detect the clouds in front of the sun to reduce the ambient light, or to generate a procedural texture) but I believe that ToD could be used on desktop games too, where there is much more power. In this specific case, too, this type of operations could be done one each 5 seconds. The clouds are not so fast to require a frequent update.

    I really hope that for future release you will plan to add these special effects. No rains, no snow, etc, but making cloud system and lighting always better.
     
  31. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Good to hear, thanks a lot!

    Oh absolutely, I don't plan on just focusing on mobile. It's just that the mobile clouds really needed a rework and I always want to make things perfect before adding something new. I'm not saying that cloud shadows won't happen at some point in the future, I just haven't had a breakthrough on how to implement them in a clever way.

    Rain and snow may come as a separate addon as I said before, but I will continue to improve all aspects of Time of Day for a really long time.
     
  32. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    I just bought Time Of Day and have been playing with it, but I'm having trouble getting a certain cloud type that I'd like. Can it make Cumulus clouds?

    http://en.wikipedia.org/wiki/Cumulus_cloud

    It seems like Time Of Day is great at making clouds that have wispy semi-transparent edges, but I would really like to get some thick billowy Cumulus clouds, with hard edges, and are thick and tall, such as cumulus mediocris clouds. Any pointers on how to get those kinds of clouds, if they are possible with Time Of Day?

    Thanks!
    Jacob
     
  33. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Try increasing both the "Sharpness" and "Density" parameter of the "Clouds" section.

    $Screen Shot 2013-08-22 at 11.12.18.png

    (The shading on this is a little bit different as it's from the current internal build, but the shape is achievable with 1.6 in exactly the same way.)

    PS: @mcmorry I'm currently looking into the Unity projectors and shaders for said projectors. All I can say for now is it looks promising.
     
    Last edited: Aug 22, 2013
  34. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    Thanks! Those look a little more defined, but they don't seem very tall. They look wide, but not tall to my eyes. I'm hoping to be able to make thick, tall cumulus clouds. Take a look at the examples in the link, and see how they are all very dark on the bottom, and then very bright on the top. Is it possible to get that? With the example you posted the dark and light areas are very close together, making it look smaller. To make it look taller, I think there needs to be a large dark area at the bottom of the cloud, and a large bright area at the top of the cloud.

    Thanks!
     
  35. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,028
    The buttons on both the web player demos are not working.
     
  36. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Well they are 2D clouds so there's only so much one can do. While the shading is being improved at the moment they will always look flatter than 3D or real clouds, and that's why I'm currently working on a 3D cloud package that will feature exactly what you're describing.

    That's the first time I hear that and they do work for me. Did you configure the fade time acoordingly with the slider at the top? The default is around 5 seconds fade time from the current setting to your new one, if you want to see instant changes just pull the fade time slider all the way to the left.

    EDIT: I'm glad to report that cloud shadows are working and will be part of the 1.7 update!
     
    Last edited: Aug 23, 2013
  37. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Very happy to read this!
    Was you able to sync some how the shadows speed, scale and density with the current clouds?
    The shader that I have allows me to scale it, translate and, playing with alpha channel, to make darker or lighter the shadows. But It's hard to sync this values with ToD settings.

    Anyway, I'm very happy to see how much effort are you putting on this plugin.
     
  38. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    Yes, it syncs with the sun position and the cloud movement in a way that the exact cloud that's in front of the sun will also be projected onto the player position. If the cloud or the sun move the shadow moves accordingly. So far I couldn't see any issues, it was actually surprisignly easy to implement and quite cheap to calculate. The main cost in rendering the shadows is the Unity projector that, as far as I know, requires all objects it is being projected on to be rendered a second time. That's why this feature is of course toggleable and should be disabled on low-end mobile hardware. The opacity of the shadows is of course configurable, too.
     
  39. aagrlp640

    aagrlp640

    Joined:
    Aug 9, 2013
    Posts:
    16
    Hi, does it accept real time? for example it takes the real time of the device?

    Best regards
     
  40. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    This looks great, infact so great that I am considering getting it
     
  41. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Yes you can set the day of the year, latitude, longitude, and the hour.

    To set the hour of the device I used this script:

    System.DateTime now = System.DateTime.Now;
    Sky sky = GetComponent<Sky>();
    sky.Cycle.TimeOfDay = now.Hour + now.Minute/60f;

    Hope this helps.
     
  42. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    I've tried that, but turning up the Sharpness seems to make all of the clouds disappear. Even if I have the Density parameter at it's highest position, if I have the sharpness parameter above half way then all the clouds seem to disappear or become whispy thin and transparent. :( This seems counterintuitive functionality for a sharpness parameter. Why is this?
     
  43. aagrlp640

    aagrlp640

    Joined:
    Aug 9, 2013
    Posts:
    16
    Can you tell me where can i put this? so that it takes the system time, and does it detects android device time, i already buy it

    Thanks :D
     
  44. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Create a new C# script component and paste this code:

    Code (csharp):
    1.  
    2.     using UnityEngine;
    3.     public class SetUserTime : MonoBehaviour {
    4.    
    5.         // Use this for initialization
    6.         void Start () {
    7.             System.DateTime now = System.DateTime.Now;
    8.             Sky sky = GetComponent<Sky>();
    9.             sky.Cycle.TimeOfDay = now.Hour + now.Minute/60f;
    10.         }
    11.     }
    12.  
    Then assign this component to the main Sky object.
     
  45. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    A high sharpness and density achieves exactly what I sent you. Start with a sharpness of 5 and increase the density until you see nicely dense, sharp clouds. You can also decrease the scale parameters if you want multiple smaller clouds after adjusting both sharpness and density.

    The reason the clouds start to disappear when you increase the sharpness infinitely is that the sharpness parameter essentially applies the pow() function to the input noise texture.

    Thanks for posting this simple script, good to see you guys help each other!
     
  46. aagrlp640

    aagrlp640

    Joined:
    Aug 9, 2013
    Posts:
    16
    Hi, how can I change values of the clouds? like Gama, Cloud Density, Cloud Plane 1 Speed, it's because i can´t change its values,the textbox is inaccesible i use unity 4.0.0f7
    Best regards
     
  47. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    What's your best guess regarding an ETA for the new version? Itching for it now! :D
     
  48. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    You can change it in the parent game object. The sky script has several categories, one of them is called clouds.

    Well the coding is almost done, after that I'll have to run some tests to make sure it's all working nicely. I won't manage to fit that in this week, but if I manage to test it this weekend a submission early next week might be possible.
     
  49. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    681
    I submitted 1.7 yesterday after testing it for almost an entire day on different devices and it should be available within the next couple of days. It will be the biggest release yet, so even though I did more testing than ever before you should keep a backup copy of 1.6.1 around in case you do find a bug in a feature that's relevant to a project you plan to release very soon. As always please report any issues you may find, I made some time in my schedule to be able to work on a hotfix if one is required.

    Version 1.7 Changelog:
    • Fixed an issue where the sun could incorrectly travel around the north, even though the location is in the northern hemisphere (Thanks Gregg!)
    • Fixed an issue that led to the brightest parts of the sky dome being slightly too dark
    • Fixed the automatically calculated fog color not being exactly the same as the horizon
    • Added a name prefix to all components to prevent name collisions with other packages
    • Added cloud shadows (can be disabled)
    • Added UTC time zone support
    • Added a parameter to configure the color of the light reflected by the moon
    • Added parameters for wind direction in degrees and wind speed in knots
    • Added an option to automatically adjust the ambient light color (disabled by default)
    • Added a parameter to adjust the sun's light color
    • Added a plane with an additive shader at the sun's position to always render a circular sun
    • Added dynamic cloud shape adjustments to the "Low" prefab (cloud weather types will now also work)
    • Added shading calculations to the "Low" and "Medium" prefabs
    • Improved the performance of "Low" prefab by reducing the vertex count
    • Improved the performance of "Low" prefab by removing the moon halo for that prefab by default
    • Improved the cloud shading of the "High" prefab
    • Improved the visual quality of the weather presets
    • Improved the calculation of the sun's position
    • Changed the automatic fog color adjustment to be disabled by default
    • Changed the moon halo to adjust according to the moon phase
    • Changed the name of the parameter from "Color" to "AdditiveColor" for both day and night
    • Changed the cloud animation to support network synchronization
    • Changed the default tiling of the stars texture to 1 (was 3)
    • Changed the moon vertex count in all presets to scale with the device performance
    • Removed the parameter "CloudColor" from "NightParameters" as it is now derived from the moon light color
     
  50. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Wow, sounds like a massive fantastic update, can't wait to try it out!

    I wonder what that means exactly? :D
     
unityunity