Search Unity

TENKOKU - Dynamic Sky

Discussion in 'Assets and Asset Store' started by chingwa, Apr 12, 2015.

  1. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Can you look at the attached screenshot? The quality of the clouds, etc seems much lower than what I have seen in the asset store screenshots/video/etc. What do I need to change to make this better?
     

    Attached Files:

  2. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    There are better ways to go about it that aren't hacky. Basically you just create a set positions in the vert function that look exactly like what you were doing like: o.p2 = v.vertex + normal * .098; etc. You pass all those into the frag/surface function and just calculate. It should be possible to get exactly the same results this way - and it'd be way faster. But it would really be a ton of work. I'm no shader guru, but I think this would definitely be a huge leap in performance.
     
    Deleted User likes this.
  3. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Several of my assets lately have private repos with access for those that want it. I would recommend at the least to start using Git (or really any source control) for development so you can split your dev up into branches and requests. I use it for my regular job and it has been great for the last few years, and before that we were using SVN.
     
  4. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    I would want to help contribute if you have a private repo. There's plenty to try to optimize.
     
    frosted likes this.
  5. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Can you add a script or something for clouds shadow? like time of day.
     
  6. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    90
    @chingwa

    First off, I let me say this is perhaps the best day/night/weather system I've seen on the asset store yet, so props and kudos for that!

    I have a few questions about the system before I go ahead and buy it for our game (and a little background so you can better understand the questions):

    We're using some established software design patterns in our approach to making a game in Unity, that Unity itself doesn't support (such as dependency injection). We're accomplishing this by using extension methods, and by creating any non-static object in code (leads to a lot more code, but also modular and decoupled code and design in general, and us coming from "traditional" software land was the only real way we could move forward with our game in Unity).

    1. Instead of dragging everything into the scene at design time, can everything needed to get it up and running be done in code? I'm pretty sure the answer is yes, since if it's all prefabs and such we can just load them from Resources and instantiate them into the scene/add whatever components are needed).
    2. I noticed the system looks for the main camera. It's possible, since we are creating the main camera in code that the camera might not exist yet (won't know till we figure out dependencies and the order these'll need to be created as we have to avoid circular dependencies). Is there a way to explicitly set the main camera object in code?
    3. We have our own game time clock (and use a 30 day season/4 seasons per year calendar). Is it possible to push our times to the system (it looks like maybe the SendMessage method might work, though it would be preferable to call into the system directly).
      1. For our calendar, it looks like we should just determine specific real life days to condense into the appropriate season so we get a range of moon movement and day length and such. Is that accurate?
    4. Is it possible to explicitly set the weather? In our game weather for the next day is determined the day before, and that weather will persist for the entire day.

    Thanks!
     
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @tylerw.savatronix Thanks for your interest in Tenkoku! :) In answer to your questions....

    1) Yes everything can be setup from code. As you suspect it simply involves instantiating a prefab in your scene and adding a couple components to your camera.

    2) Tenkoku shouldn't cause any problems if it's in your scene without a camera. When you decide to add a scene camera it can either have the MainCamera tag, in which Tenkoku will pick it up automatically, OR you can manually configure Tenkoku with a specific camera through code, yes.

    3) You can access and set time/date variables directly. In previous versions this could be done through C# with SendMessage, but in recent and current versions you can access the C# code directly. Setting specific day and time will automatically give you accurate moon phase/movement/day length, assuming you also put in the correct latitude setting for your in-game location.

    4) Yes you can directly access and set weather variables, including cloud coverage, rain/snow amounts, wind, fog, lightning settings, rainbows etc. Currently this is the recommended method actually, but once the advanced weather generator is included you'll still be able to change these variables if need be.

    Let me know if you have additional questions or concerns.
     
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @ksam2 Cloud shadows are on my feature "to-do" list, but I'm not sure when this will get addressed yet.
     
  9. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    @chingwa As a paying customer, we could really use a response on emrys90's question. We're running into a number of issues and would really like to use your asset in our game.
     
  10. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @ForgedChaos @emrys90 Sorry I missed your question! The cloud screenshot looks relatively normal to me, but perhaps my monitor is too dark. I do see what looks like some banding artifacts on the thinner clouds, is this what you're speaking of? I don't really see those artifacts on my system here. I always recommend to use both Linear render mode with HDR set on your camera to get the most dynamic range in Unity.

    You can also try setting the tex_clouds_a_hires and tex_clouds_b_hires textures (under TENKOKU/TEXTURES/...) to be 'truecolor' on the texture import settings. If you still have trouble then perhaps you can give me your exact date/time/latitude/ and cloud settings and I'll see if I can recreate this here.
     
  11. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    @chingwa Thanks for the response! We'll look in to it and get back to you.
     
  12. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @ForgedChaos @emrys90 Also, it's possible you may have a texture quality/resolution override set in your quality settings that is preventing the full resolution for the cloud textures... I can see how that might cause a banding issue such as this. The native resolution for the clouds are 4069px... the closer you can get to this in your project the better they will look.
     
  13. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Thanks for the suggestions. We did not have HDR enabled on the camera. I enabled that, and in our Quality settings the Texture Resolution field is set to Full Res. The clouds and sky are still looking pixelated though.

    Also, any progress made on the networking? We don't even care too much about the cloud positions at the moment, but the type of clouds aren't always the same. Like on one client the sky is dark filled with clouds, and on another client there aren't any clouds. This is especially noticeable when a new client joins, there usually isn't any clouds on their screen at all.
     
  14. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @emrys90 Not yet I'm afraid. I've been mired down in a C# conversion for my water asset. But that is almost finished and I'll be able to jump back onto Tenkoku updates soon. Sorry for the delay. I expect to be able to look into this more in depth next week.

    In the meantime for the pixelated clouds, if you can give me your exact cloud/time/date/latitude settings I'll see if I can recreate the issue on my end.
     
  15. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa The cloud settings is using the automatic random weather, so I don't know entirely. Everything looks pixelated though, not just the clouds. You can see bands in the sky, around the sun, etc. It looks worse for the clouds if the clouds are almost directly overhead, not so bad if they are far away. The time/date I start at:
    tenkokuModule.currentYear = 2000;
    tenkokuModule.currentMonth = 6;
    tenkokuModule.currentDay = 11;
    tenkokuModule.currentHour = 15;
    tenkokuModule.currentMinute = 30;
    tenkokuModule.currentSecond = 0;
     
  16. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    Playing around with the demo and close to buying this.

    How much control would I have over the colors? For instance, when the sun is close to the horizon, there's a distinct yellowness I don't care for that I'd like to tone down or change to something else entirely. Is that possible to do? How are colors handled in the system?

    Here's what I mean:

     
  17. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    It is very pretty but performance is iffy. I am not all together happy with it. It really needs some performance tweaking. Along with Suimono, it pretty much destroys my fps and that is in a scene with little more than terrain.
     
    Ony likes this.
  18. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    Are you using all of the sound effects options and everything it has? If I got it I'd probably rip most of that out and use some of the cloud stuff and the time of day lighting, but sounds, rain, etc. I'd handle outside of the system. Just trying to figure out what it might be that people are saying effects performance.
     
  19. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    That might work. It seems from what people are saying in this forum, it is the cloud system that is having the worst impact. I have not even tried rain, etc. although I do have the sounds in. The sky is definitely pretty. I haven't had the time to mess with it as I am busy with several other things at the moment. Just a warning....read the forums carefully. I love the way it looks, but I worry about its practical applications. Most of the folks who recommended it to me make scenes for assets, to look pretty, and are not worried about performance. But I am. I should have been more careful. :)

    I also have a black sky in edit mode which just bothers me. :) That might just be me though.
     
    Ony likes this.
  20. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    OK, great, thanks for the info, @Teila. I'll do some more reading. :)
     
  21. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @Ony To be honest, while you do have a large amount of control over various colors in the sky/lighting etc, the twilight coloring that you speak of can be tricky to adjust depending on what you're looking for. There are some included options in the UI for quickly adjusting sky/light colors, but there is also a gradient lookup texture which controls color over time of day. The gradient texture can be adjusted in photoshop or another image editing program. If you have an example image of how you want the sky in your project to look then I can tell you better whether it can be adjusted to match or not.

    @Teila I'll be looking into some performance improvements soon (and the clouds!). But make sure you have the included reflection probe turned off, as this might be adding unnecessary computations in your scene. As for the black sky in-editor... I haven't seen this on my end. Are you not able to adjust time and have it update in edit mode? I wonder if turning on 'continuous baking' in the Unity lighting panel would help (not sure why it would matter, but I'm sure we all know how temperamental Unity can be sometimes).
     
    Ony likes this.
  22. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Any other ideas on how I can fix the pixelation banding issue?
     
  23. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Well, glad it is a mistake and not a feature!

    I do not have continuous baking on. I used deferred linear. It has nothing to do with time. The sky is a black box, so to speak. Nothing on there. Nothing I did would change it.

    Glad to hear of the performance tweaks coming.
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @emrys90 do you perhaps have other image effects on your camera, either before or after the Tenkoku image effect, that might be influencing this?
     
  25. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa There are other image effects on the camera, not sure if they would be affecting it though.
     
  26. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    Thanks @chingwa. I just went ahead and purchased it so I'll play around a bit and see what I can come up with. :)
     
  27. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa I tried turning off all my camera effects except the Tenkoku ones, and it still seems pixelated/banded.
     
  28. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Thanks a lot @Ony Enjoy! let me know if you run into any trouble.

    @emrys90 I'm really not sure what's going on here. You mentioned other parts of your sky have banding as well, sun etc. Can you show me a screenshot of this? You can email it to konnichiwa[at]tanukidigital.com if you'd rather not post here.
     
    Ony likes this.
  29. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Here's a screenshot of banding around the sun
     

    Attached Files:

  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    OK I see what you mean. I get this as well, albeit to a much lesser extant. Part of this is just down to the color accuracy in unity trying and failing to do subtle blend effects... especially when it comes to shifting to darker colors. You may notice similar issues using the Unity procedural sky shader as well, particularly during evening/dusk when the sun is low and the sky is dark. However this is definitely made worse in gamma mode, as opposed to linear (as it doesn't have as wide a color range). I would recommend linear if at all possible.

    You might have some luck in increasing the resolution of the sky render from 512px up to 1024px... you can do this by manually editing the resolution settings on the TEXTURES/renderTex_skyFog texture, though it didn't make much of a difference on my end.

    One common way to help alleviate color banding issues such as this is to add a very subtle noise effect over the top. You can do this either on your own scene camera, or if you only want to affect the sky you can add a standard noise effect to the Tenkoku-->Tenkoku_SkyFog game object. You'll have to experiment a bit to get an acceptable result as too much noise becomes distracting and too little doesn't reduce the banding properly...

     
  31. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    We already switched to using linear previously. I tried everything else you suggested, and here's the results.
    The banding does seem to be better, but it's still there. Any other ideas on how to get that better, or is this now the best we can expect? The clouds still seem pixelated though when up close.
     

    Attached Files:

  32. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Here's another example of the clouds. See all those splotches?
     

    Attached Files:

    ksam2 likes this.
  33. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    Thanks again @chingwa. Loving it so far. I tweaked the colors a bit and getting some nice results. Also wrote an extension script which uses a separate (new) gradient ramp texture to control overall tint and sky tint via gradient over time. Pretty awesome so far! I'll post some screen shots when I finished messing around.
     
    chingwa and BackwoodsGaming like this.
  34. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @emrys90 I think that might be as good as can be expected really. I do get banding on my end as well, though I hadn't noticed it to the extant you see on your end. I'm not sure what other settings would contribute to this, as it seems your project and camera are all running in the recommended modes.

    @Ony that's great to hear. I look forward to seeing what kind of results you get. :)
     
  35. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Okay. What about the clouds and splotches though? Anything I can do about that?
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @pauarb Just FYI, I did save your posts about performance impact from the old forum... I don't know if they need to be reposted, but I have them as a reference on where some of the impact may lie.
     
  37. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Great! Now let's continue the discussion of a private code repository... ;)
     
    Teila and John-G like this.
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    I tell you what... I'm going to make a github account today, and get myself acquainted. Then we can go from there. :)
     
    Teila likes this.
  39. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    If you want to look at something self hosted, Digital Ocean has a GitLab install instance that is nice and fast. We use one internally for some of our projects so that it gives us complete control over users and access permissions.
     
    chingwa likes this.
  40. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    I'll look, self-hosted may be better. I may PM you later with some GITty questions.
     
  41. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    I used GitLab for a while. I liked it much better than GitHub and it allowed private repositories even on free accounts, unlike GitHub. Of course self-hosted would allow that as well. I had problems wrapping my head around the whole Git workflow and ended up reverting back to SVN repositories. But if you are going with a Git solution, I would highly recommend giving GitLab a try! :)
     
    chingwa likes this.
  42. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I flat out STRUGGLED with GIT for a good year or more after working with SVN for about 10 years. I finally have it all figured out, mostly due to weird little differences that took me a while to understand like local commit vs push. Now that I have GIT mostly figured up I imagine they will make a new method soon!
     
    BackwoodsGaming likes this.
  43. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Lol.. Yeah.. The new GoT method... lol Would be nice instead of making new methods they would just put the time into improving the old!
     
  44. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    I'm looking more into GIT today. I can see it might be quite beneficial to use even just for myself. :D It is certainly a different way of working for me though, something I'll have to get used to. Right now I'm actually leaning toward GitHub, just because of the ease of use. I'll have more to share soon, once I've done some more testing and have more thoroughly familiarized myself with this new-fangled way of working :D
     
  45. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @frosted Going back over the cloud shader example code you posted, I realized it isn't going to work the way you described. In order to do this in surface you need to run the UV coords through a function that takes the view direction and normals into account. Your strategy of integrating it all into a single surface pass is a good idea though! I had developed a custom interior map shader a while back, and I believe the technique I used in that can be applied here. I'll know more soon.
     
  46. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Any news on the networking stuff?
     
  47. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @emrys90 sorry no update on the networking quite yet. I'll post some news here when I know more.
     
  48. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    @chingwa Do you have any kind of timeline for when you will be able to get this resolved? Networking support was the primary reason we went with this asset. My manager is wanting some kind of progress to be made on this, or at least a timeline for when you expect to have it resolved, or he will be asking for a refund and leaving a bad review.
     
  49. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @emrys90 While I don't have a specifc timeline to share, I'll clue you in on what's happening on my side and that will give you some insight, rather than just not seeing progress on your specific problem.

    Currently I'm working on a revision to the cloud shader, as I've gotten a lot of feedback about performance issues with the current clouds. This has involved a complete shader rewrite... and of course cloud movement is affected by this. Until the new updated cloud system is in place it isn't beneficial for me to work on cloud network syncing issues. Hope you understand!

    I've completed the first revision on the new cloud code this morning and this will go through some testing. Until I get those results I won't know how much more time I'll need to put into them to get them more performant. Once the new clouds are in place I can go back and look at cloud movement/syncing issues, and work on a fix. If all goes well this could be ready in about a week. But if the cloud updates takes a longer then the syncing will take longer as well. I don't mean to be evasive, it's just there is a process I'm working through and I don't want to give out a specific timeframe without being more sure.
     
    ksam2 and Bagnol like this.
  50. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @chingwa Do you think you could look into cloud shadows when rewriting the cloud shader? There is this, but I reckon it will be pretty much impossible to match it up with Tenkoku clouds, and easily noticeable to the player.