Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Time of Day - Dynamic Sky Dome

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

  1. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654

    Time of Day is a package to render realistic dynamic sky domes with day and night cycle, realistic celestials, dynamic clouds and physically based atmospheric scattering. Requires Unity 4 or higher. Does not require Unity Pro.

    Sky
    • Physically based sky shading
    • Rayleigh & Mie scattering
    • Highly customizable
    • Sun and moon god rays
    • Aerial perspective

    Lighting
    • Full PBR & HDR support
    • Realtime Unity 5 ambient light
    • Realtime Unity 5 reflections

    Clouds
    • Physically based cloud shading
    • Semi-volumetric cloud layers
    • Dynamically batched cloud billboards
    • Adjustable wind speed & direction
    • Configurable coverage and shading
    • Correctly projected cloud shadows

    Time & Location
    • Dynamic day & night cycle
    • Adjustable time progression curve
    • Full longitude, latitude & time zone support
    • Full Gregorian calendar support
    • Realistic sun position
    • Realistic moon position and phase
    • Realistic star constellations

    Performance & Requirements
    • Extremely optimized shaders & scripts
    • Zero dynamic memory allocations
    • Supports shader model 2.0
    • Supports all platforms
    • Supports linear & gamma color space
    • Supports forward & deferred rendering
    • Supports HDR & LDR rendering
    • Supports virtual reality hardware

    Links

    Screenshots

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
     
    Last edited: Jul 14, 2015
  2. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    518
    You by chance have a web build of this so we can see the TOD and clouds animating?
     
  3. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    I just uploaded a web player demo. It has a user interface to configure some of the parameters so that you can get an impression of what is possible to achieve with the package. The automatic day/night cycle is disabled in the demo, you just set the time of day with the upper most slider.
     
  4. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Version 1.2 just got released with a number of fixes and new features. It is now possible to adjust the sunlight falloff at sunrise and sunset. The cloud system has been greatly improved with a nicer overall look and parameters to adjust cloud color (dark or light clouds), coverage density and cloud shape to your liking.

    Version 1.2 Changelog:
    • Fixed some bugs regarding linear vs. gamma space rendering
    • Fixed some issues with the horizon fadeout
    • Adjusted sun and moon size
    • Optimized sun and fog color calculation
    • Greatly improved visual quality of the cloud system
    • Added parameter to control cloud tone, allowing for dark clouds
    • Added improved stars texture at night
    • Added parameter to control the sun color falloff speed
     
  5. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974
    How is the performance on mobile devices? Especially on the first generation iPad.
     
  6. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,502
    Sunrise/sunset is a bit red...otherwise, very nice!
     
  7. hellraizerhhh

    hellraizerhhh

    Joined:
    May 26, 2010
    Posts:
    619
    Never seen a red sky, need to tweak or remove that area of the transition :)
     
  8. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974
    This is the most red sky you might see on some special winter mornings here at a latitude of 52° N.

    $ZZ6CF56304.jpg

    One problem is that the game camera will always show a smaller part than the human field of view, but overall the sky is way to red. I've seen similar problems with the "silverlining" clouds sky package that will always show a red horizon in winter at this latitude (actually this is correct because of missing haze) but this won't be such a huge problem when the terrain has some slight hills.

    Beside the need of fixing the red sky, will you later add date, latitude and longitude to your package?

    I also would like to see a webplayer without any trees and hills to see more of the clouds and horizon before I can think of buying.
     
  9. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Thanks for the feedback guys.

    First of all, about the red sky: V1.2 added a parameter to configure the sunlight falloff, if you set his parameter very low (e.g. 0.1) you can completely remove the red stage of the sunset/sunrise. I forgot to add this to the webplayer before, but you can test it in the new one I just uploaded. If you have any other questions or suggestions regarding the scattering calculation feel free to post them.

    About the performance on iOS: I only have a third generation iPad (the first one with a retina display) and it handles it really well (reaching the 30 FPS cap in my test). The second generation iPad tends to have a better performance than the third generation (because it only has to fill 1/4 of the pixels), so it should work even better there. I cannot say anything about the first generation iPad however because I never got the chance to run the package on one.

    Date, longitude and latitude are actually already in there. However, for the time being only date and latitude influence the sun's position. I can of course also add the calculation for longitude if this is a thing a lot of people would like to see, so far I just assumed this is nothing too many people would need.

    Last but not least I added a second web player demo scene that consists of 4 cubes and the sky dome. You can choose the scene you want to load, so the web player link did not change.

    Thanks again for your replies, please continue to post anything you would like to see changed or added.

    EDIT: If the web player does not ask you what scene to load, just refresh the page. The old one might still be in your cache.
     
    Last edited: Apr 15, 2013
  10. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,502
    Sorry to see that 4.x is required, I'm still on 3.5 :(
     
  11. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    The package does actually work with Unity 3.x, but I submitted it to the Asset Store with 4.x and apparently they limit the usage to 4.x because of that. I just tried to export it as a package in 4.x and import it into 3.x but it looks like the asset export format is incompatible between major releases of Unity. I'll look what I can do to submit the next update with 3.x so that you can download it properly.

    Speaking of the next update, please do send me all feature requests via personal message, email or a post in this thread so that I can prioritize the things you guys want to see in my development schedule. So far the ideas for 1.3 are to add an optional lens flare effect (this is a little hard as most lens flares look incredibly unrealistic and I'm trying to create a realistically looking one) and some sort of automatic weather manager (which may include rain and snow particle effects).
     
  12. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,018
    The problem with sky domes (spheres...) is the clipping distance view when the skydome has to be very large ( in a big scenery, terrain...), because, in order to "see" the whole sky without clipping artifacts you have to use necessarily a very large far clipping distance (adding draw calls) or use a second camera, adding complexity to the scene.
     
    Last edited: Apr 16, 2013
  13. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974
    I would say a second camera is not a bad thing at all. It can help a lot with z-fighting issues. And cubic skies just look terrible artificial.

    Would be really good to have an option to use latitude, longitude and UTC.
     
  14. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,502
    Thanks for working on getting this in Unity 3, plz. If this is a hassle, I may end up upgrading to Unity 4. I'm still very much on the fence, though.

    I agree that a 2nd camera is a good thing, it keeps my main camera from having a huge draw distance.
     
  15. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    75
    Could you may provide an android apk demo? =)
     
  16. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    You can adjust the sky dome such that it is exactly as big as your clipping distance. The sky dome won't change its appearence just because you scale it up or down, I made sure of that. You are of course free to use two cameras, but my package is not limited by your clipping plane in any way because you can just adjust the sky dome scale according to your project's settings.

    While the package should run on Android I personally don't develop for it. I do own one of the free Unity Android 3.x licenses they gave away ahead of the 4.x announcement, but I have never used it. If there's an issue I will look into it, but I cannot provide any Android examples for now as I focus on Desktop and iOS development.

    I'll look what I can do in 1.3 regarding these things. What I probably won't do is to calculate the sun and moon position based on the exact real-life date because it will just add a huge overhead for an effect that barely anyone will ever notice. I also don't want it to become too earth-specific as the package should be applicable to all sorts of planets as good as possible.

    Speaking of 1.3, I might look into completing the height parameter that will allow the sky dome to adjust according to the viewer's height in the world. The basis for this is already implemented but there are some things left to do and it would allow the sky dome to be used in flight simulator games, given that you use it together with a volumetric cloud system.
     
    Last edited: Apr 16, 2013
  17. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Time for a quick development update: I locked myself into my coding cave and sat down to optimize the package performance for mobile.

    I benchmarked the absolute worst-case scenario that the complete sky dome has to be rendered (no occlusions by other objects). If for example half the sky dome is occluded by other objects, the frame rate will double.

    Before the optimizations:
    iPhone 4 / iPad 1: 10-15 FPS
    iPhone 5 / iPad 3: 30-40 FPS

    After the optimizations:
    iPhone 4 / iPad 1: 40+ FPS (EDIT: after some further optimizations I am now at 60 FPS on the iPhone 4)
    iPhone 5 / iPad 3: 60+ FPS (iOS does not render frame rates above 60)

    This was mainly achieved without any visual loss in quality. I did however implement a mobile version of the cloud shader with two changes compared to the desktop version: the "Cloud Sharpness" and "Cloud Shading" parameters are being ignored. This is because these parameters have to be applied per-pixel, which would cost 10+ FPS on the iPhone 4 and iPad 1. Newer generations are able to do these calculations while still reaching the frame rate cap of 60, so you might be able to use the desktop version of the cloud shader there. You can also achieve the same effect the "Cloud Sharpness" parameter has by just editing the cloud noise texture manually. I might add different versions of this texture to the package if this is something people would like to see.

    Completely disabling the cloud layer also greatly improves the frame rate, so if you don't need any clouds you could probably also get 60 FPS on the iPhone 4 and iPad 1.

    In other news, the downgrade of the project from 4.x to 3.x is a little bothersome, but I will try to get this done some time this week. All that and an improved implementation for latitude / longitude are planned to be released in a few weeks or even days, so stay tuned.
     
    Last edited: Apr 22, 2013
  18. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,502
    Thanks for making the effort to support 3.x, and the optimizations are great news!
     
  19. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    A few things that happened today:
    • The project is now on Unity 3.5 so the next update should make the package available for download for 3.x users
    • After some further work on the shaders I now have 50-60 FPS on my iPhone 4
    • I added a realistic sun lens flare effect and an additional parameter for how much the sky color is being influenced by the sunlight and therefore the sun angle, resulting in some pretty neat new sunset configurations - a few examples with different parameters:

      $screenshot-03.jpg
      $screenshot-07.jpg
      $screenshot-11.jpg
    • The moon has been reworked a little (added a lens flare, reworked the moon phase rendering), leading to a better overall look:

      $screenshot-04.jpg
      $screenshot-08.jpg
     
  20. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974

    Does that mean 100% of the screen was filled by the sky dome during the tests?
     
  21. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Exactly.
     
  22. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974
    perfect!
     
  23. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Alright, today the 1.3 update got approved to the Asset Store. The focus lies on mobile performance and compatibility improvements as outlined earlier in this thread, but I also achieved some pretty major improvements in visual quality, especially concerning the sunrise and sunset. The terrain demo scene got reworked and I updated the screenshots, just make sure to refresh the page to clear the old ones from your cache.

    Version 1.3 Changelog:
    • Greatly improved performance on mobile devices
    • Greatly improved sunset and sunrise visual quality
    • Added a parameter to control how strongly the sun color affects the sky color
    • Added realistic sun and moon lens flare effects
    • Added two additional cloud noise textures
    • Improved handling of latitude and longitude
    • Made the sky dome render correctly independent of its rotation
     
  24. daisyDynamics

    daisyDynamics

    Joined:
    Dec 29, 2011
    Posts:
    314
    I've configured this for my latest game and it provides an excellent day/night cycle (and animated clouds) with minimal performance impact. Additionally, the developer support is great - I had some issues initially but they were unrelated to Time Of Day (they were lightmapping issues). However, the developer pointed me to a possible solution, which turned out to be correct.

    My only suggestion for improvement would be to provide a better star field texture for the night sky (as there's a slot there for it at Sky Dome > Sky > Star Texture). The existing texture is very dark.

    Also, the distribution folder should be renamed from "AssetStoreData" to something more meaningful (like "TimeOfDay"). :)

    Overall, a fantastic asset - a simple and straightforward way to implement a realistic day/night cycle into a game.
     
  25. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    183
    This is amazing.

    I'm impressed because of the effort you went to get this running smoothly on mobile. It runs brilliantly on my mobile devices, only docking a few FPS where UniStorm Mobile was absolutely destroying the poor things and completely unusable.

    A few things to make this even better:

    - I'm writing a flight simulator and the clipping plane had to be massive. When I scaled the Sky Dome to 3000+ it seemed to break a little. It still worked, but the sun was different and the definition between the horizon seemed lost. I couldn't use it like that, especially when it looked brilliantly with a small scale. What I did instead was use the sky camera script, keep the scale small, and modify the shader.

    - The stars need to be more noticeable! Might be able to fix this myself with the stars texture, I'm not sure.

    - The night color is too dark. The sky doesn't get black at night, especially with the moon. I'd like the option to set the nighttime base color to something more artistic, like dark blue/purple. It'd be magical.

    - Storm / rain options.

    Thanks, you lifted my flight sim to new heights (ha ha) with this asset.
     
  26. daisyDynamics

    daisyDynamics

    Joined:
    Dec 29, 2011
    Posts:
    314
    I agree, the stars need to be brighter and the night sky is way too black - the moonlight looks fantastic on the landscape, but the night sky should be brighter.

    Storm/rain options - well, that would make this asset absolutely perfect.
     
  27. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    First of all, thanks for the kind words and the amazing reviews you guys left in the Asset Store!

    Yeah I'm not entirely satisfied with the night visuals myself. That's why I recently added the option to render atmospheric haze at night (this will be in the next update) and I'm also going to see what I can do to improve the star texture. Thanks for your feedback on this, it helps focusing on those areas that are in need of improvement the most.

    I'll look into it.

    This really shouldn't happen. I actually also forgot to add "Fog { Mode Off }" to the shaders (I must have lost this line somewhere in my optimization workflow) so this can also lead to issues with increasing sky dome scales. Rest assured that these issues will be fixed in the next release.

    I have mixed feelings about this as I want to keep the focus of the package on the important things. However, an optional rain and/or snow particle effect and maybe a weather type manager might be within these boundaries.

    Quick question: What are your thoughts on the pricing of the package? Given that it's both mobile and desktop within one purchase I'm tossing around the idea to increase the price a little as soon as the foundation is complete and I don't receive any more bug reports. Comparable packages (with, in most cases, a greatly reduced quality in code, visuals and performance) tend to cost more than Time of Day, even though they only work for either mobile or desktop.
     
  28. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,502
    Kudos for keeping the system straightforward and focused. I think what you have is pretty good.
    I think the price is a good price.

    Is it practical (or even feasible) to release different systems separately that work with Time of Day? Like...a rain system that works with it? A snow system? More advanced clouds? I don't know how difficult that would be...because each would affect lighting and such.
     
  29. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    183
    I changed the stars texture to include a background with some color. It's not perfect, but it's a big improvement. Excellent that you included that option.

    The main reason I suggested that is that weather includes clouds and fog. Something that this already does. Weather also adds a ton of atmosphere to a game and since you made this run so well on mobiles, I have to encourage you to try it. That said, keeping the scope small allows you to have laser precision on what matters. I do think those features go and hand, however.

    Well, at $50, I felt a took a little gamble on it. It was the comments in the asset store and the forum that ultimately swayed me to give it a shot. The asset store can be hit or miss sometimes. Now I know that this was well worth the price, and I hope I can convince others it is too.

    Compared to the others I've tried. It has better performance and visuals. The code is cleaner. It feels like witchcraft that it can run on my mobile and look as nice as it does. If you add a weather system, even as sort of a paid module, I'd consider purchasing that too. I think that's the only thing competing systems have that this doesn't. If you added a "rain cloud" option or "dense fog" option, I'm sure most developers could add the rest (the particles) without any trouble.

    Hope that helps!
     
  30. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    The work on 1.4 is coming to completion, the changes I made so far are the following:

    Version 1.4 Changelog:
    • Added "Fog { Mode Off }" to the shaders to properly ignore fog
    • Added the parameter "Night Cloud Color" to render clouds at night
    • Added the parameter "Night Haze Color" to render some haze at night
    • Added the parameter "Night Color" to add some color to the night sky
    • Renamed the parameter "Haze" to "Haziness"
    • Renamed the parameter "Sky Tone" to "Brightness"
    • Renamed the properties "Day" and "Night" to "IsDay" and "IsNight"
    • Restructured all sky parameters into groups
    • Improved the sun lens flare texture
    • Improved the stars texture
    • Fixed a rendering artifact at the horizon for low haziness values
    • Made the scattering calculation in gamma space look identical to linear space
    I still want to test it a little and will submit the update for review on Monday.
     
  31. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    1.4 is out!
     
  32. daisyDynamics

    daisyDynamics

    Joined:
    Dec 29, 2011
    Posts:
    314
    Fantastic update - many thanks! I've re-enabled my fog, and the night sky haze now looks just about perfect. Love the new star texture too - a great update!
     
  33. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,428
    This looks very useful for a current project -- but I need an accurate night sky, with a coordinate grid so I can place game objects up in the sky precisely. Looking at the Package Contents on the asset store, it looks like the star texture is simply a tiling texture that repeats across the dome. Is it possible to place an all-sky image and position it for accuracy?
     
  34. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    If I understand correctly you have a texture that contains your complete night sky and you want it to fill the entire sky dome? For something like that it looks like what you actually want is a cube map, which is not supported by the package at the moment. However, you might be able to work around it by rendering your night sky with the built-in Unity skybox camera option and only using the scattering, clouds, sun and moon from the package.

    I'd have to add transparency support (meaning everything that's filled with my night sky texture at the moment is transparent afterwards). It's no big change and I can implement it if you are interested, but first you should verify that the built-in skybox camera option would work for you. If you render your night sky manually this approach should also work, you could just use your current night rendering technique and add the rest of my package (with transparency at night) for everything else.
     
  35. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,428
    Thanks for the fast reply, and yes, I have an all-sky image. I do already have it as a cubemap/skybox, but it would need to rotate in synch with the rest of the Time-of-Day cycle -- and it would need to fade out for dawn to dusk. Would I need to program that separately or would Time of Day handle that already? And if I switched to a sphere instead of Unity's built-in skybox system (since I also need to plot things on the sky using celestial coordinates), would that work better or worse with Time of Day?
     
  36. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    How you implement it really shouldn't matter if I just add transparency support to Time of Day. You can imagine the rendering queue for your scenario like this:

    1. Your stars texture is being rendered, filling the complete screen
    2. Time of Day renders the atmosphere with one modification: the stars texture is replaced with something completely transparent, meaning that your previously rendered night sky is visible everywhere the stars texture is visisble at the moment

    What do you mean with rotating your night sky? Also, would it be possible to send me the sky box so that I can implement the changes and make some screenshots for you to verify?
     
  37. DevKirbyrawr

    DevKirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    922
    Your system seems great :).
    Unnfortunately i can't buy your system because i have one haha.
    Keep up the good work ^w^
     
  38. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,428
    I mean integrating my skysphere with the day / night cycle, so they rotate in synch, and so my skysphere fades away at dawn and fades in at dusk.

    I don't have my skysphere set up yet, but I'll likely use this: http://home.arcor-online.de/axel.mellinger/images/mwpan_polar2_s.jpg, mapped onto two hemispheres.
     
  39. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Dawn and dusk will of course be handled by the package as it will just overlay your sky dome at day and when the scattering fades out your sky dome will slowly become more and more visible. If you want to rotate your sky dome (e.g. with the date) you'll have to do this on your own, but getting the required information from Time of Day should be easy enough.

    I implemented a version of the sky shader that fades out at night instead of switching to a night texture and I'll include it in the next release. It can be used in combination with the built-in skybox functonality of Unity or with any other sky dome you might have.

    On an unrelated note, the image you posted appears to be copyrighted, I hope you are aware of that.
     
  40. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    1,974
  41. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,428
    Yes, I've gotten permission to use this image on previous projects, but haven't requested it yet for this project, which is one reason I couldn't provide you with it for testing. But glad to hear that you've added the transparency option. I will grab it when the next version is released. Have you decided whether or not to add rain/snow to it? (I would be in favor of that--even if you kept it fairly simple.)
     
  42. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    I will at least implement some sort of weather management regarding the sky/cloud parameters to simplify the process of setting up different basic weather types. When that's done I'll look into particle effects.
     
  43. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    75
    Hey, i tried the demo again, i saw tht stars just dissapear/new ones appear, alreay if move the camera a little bit?
    Looks especialy confusing if you moce the camera more faster :/ How youve done that stars? Am i able to exchange them, (cause o this issue)?

    Oh ok, the tiled Star texture has already been discussed, so hope for an update to sue a whole star texture =)
    Will buy it then ;)
     
    Last edited: Jun 3, 2013
  44. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    This is because I disabled mip mapping in the texture import settings of the stars texture, the flickering is very visible in small windows / low screen resolutions and it didn't really show up while running my tests in fullscreen. I reenabled mip mapping (all you have to do is check "Generate Mip Maps" in the texture import settings of "stars_texture.png") and updated the web players, check it out!

    In case you still don't like the texture it is in fact possible to swap it out for any other texture you'd like to have and the next update will even support using the built-in Unity skybox system at night.
     
  45. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    246
    Keep up the good work, I really like your coding-style, it's very clean and well structured.

    I think also it wouldn't be a good idea to bloat up your script with features like weather. I would prefer a separate addon here.

    I'm still having issues with the red sky. It still shows up even with very low falloff settings. But there is another problem with this. By setting the falloff parameter very low the switch between sunset and night is too fast. Maybe I need to tweak the sunlight coloring value a little bit...

    p.s. A really cool feature would be to combine substance materials with your cloud shader.
     
    Last edited: Jun 20, 2013
  46. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    That's always nice to hear, thanks!

    I'm currently implementing some basic weather management and I'll see how complex it gets. It will be encapsulated in a separate script that you can use or ignore, no matter if I decide to release it as a separate addon or as part of the package. I won't feel comfortable charging extra for it if creating it isn't a decent amount of work, so I guess we'll just wait and see how much time this is going to take.

    I dived into this area of interest once again and I'm quite positive the next update will address this once and for all. I'm currently changing the way the script tries to adjust the sun color influence and so far it looks like my new way of doing it should finally satisfy everybody's needs.

    This would be very cool indeed. I'll take a closer look as soon as I find the time, but you probably won't see this in the next update.
     
  47. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Quick development update: 1.5 is shaping up nicely, I just updated the webplayers to the new version so that everybody can have a look. I'd love to get some feedback before actually releasing it.

    Version 1.5 Changelog:
    • Enabled mip mapping of the stars texture by default to avoid flickering
    • Added support for using custom skyboxes at night (see readme for details)
    • Greatly improved the parametrization of the sun color influence at sunrise and sunset
    • Added internal pointers to commonly used components for faster access
    • Split the sun and moon parameters into their own property classes
    • Adjusted the cloud shading calculation to keep it from darkening some clouds too much
    • Adjusted the color wavelengths to produce a more realistic blue color of the sky by default
    • Made the moon phase influence the intensity of the sunlight reflected by the moon
    • Replaced the lens flares with custom shaders that are correctly being occluded by clouds
    • Enabled the new lens flares on mobile
    it might also contain the first part of the weather type manager if I decide to include it.
     
  48. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    246
    Looks nice, can't wait for the release. :)

    I've found a little "bug" (unrelated to 1.5) regarding the cardinal direction. In my scene I'm using Z as North, so I've tried to rotate the Sky Dome by 270° (Y) that the sun goes up at East. But it seems the sun and moon position are broken if the skydome position is not at 0,0,0.

    Is there any way to fix this? I'm not sure if you've taken the cardinal direction into account.
     
  49. tezer86

    tezer86

    Joined:
    Jul 19, 2010
    Posts:
    90
    This looks great, I'm pretty new to this so sorry if this is a silly question. Would like work with something like the unity toon level kit that's available on the asset store? If so how would I get it to work with that, to make the models all look correct with the transition etc.

    cheers
    Terry
     
  50. plzdiekthxbye

    plzdiekthxbye

    Joined:
    Dec 17, 2010
    Posts:
    654
    Ah damn looks like I accidentally applied the correcting rotation not only to the sun position offset but also to the sky dome position. Thanks a lot for reporting this, I'll fix it in the next update. If someone needs to fix this on his own until then, here are the required changes in Sky.cs:

    Search for:
    Code (csharp):
    1.  
    2. Sun.transform.position = transform.position + SphericalToCartesian(OrbitRadius, theta, phi);
    3. Sun.transform.position = transform.rotation * Sun.transform.position;
    4.  
    Replace it with:
    Code (csharp):
    1.  
    2. Sun.transform.position = transform.position
    3.                        + transform.rotation * SphericalToCartesian(OrbitRadius, theta, phi);
    4.  
    And do the same for the moon. This is really only necessary if you both rotate and move the sky dome, only rotating or only moving the sky dome works just fine. Thanks again for reporting this silentneedle!

    I'm sot sure if I understand the question correctly, but if you're asking about toon shaders: The package should work without any issues with both toon post-processing shaders and toon material shaders. In both cases the sky dome won't be affected by the toon shaders as it doesn't write to the depth buffer. If you want toon-looking clouds this could for example be achieved by replacing the cloud texture (just add some banding to it) and enabling ZWrite in the cloud shader (search for cutout shader). That way the toon post-processing would also affect the clouds.