Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TENKOKU - Dynamic Sky

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

  1. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    I look forward to seeing a really "BASIC" or "LITE" option for scenes that have a lot going on.

    This will allow to use Tenkoko in all scenes, and not have to use multiple weather systems.

    Perhaps it uses different sub-components to keep resource use at an absolute minimum. Essentially it needs to be a very simple sky system, but still controlled through Tenkoko options so its easy to handle weather in different scenes, and depending on players PC specs. ie, So most common weather effects would be similar, just very basic (resolution, depth, and complexity etc) - so not as "pretty" but at a massive performance gain, so "busy" scenes can have decent FPS.
     
  2. Kazunori_Yoshimoto

    Kazunori_Yoshimoto

    Joined:
    Apr 3, 2015
    Posts:
    1
    Do you support the iOS?
     
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Not officially no, iOS and Android has not been tested and is thus not supported.
     
  4. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Hi Justin,

    So quick question; I've been noticing for a long time but didn't have the time to look into it right now, that Tenkoku's fog sliders only change the density of the fog, not the range that it begins, and I was wondering if you could tell me in what code file and what line that's specified and how i can change it to a set distance?

    Tenkoku looks best on what I'd consider short distances, but since we're running a 6km view distance, the fog doesn't even start until what looks like the 4km range which is not great. It wasn't until we had a view distance slider that i noticed the fog was getting closer or further away as your camera view distance increase or decreased.

    Thanks again!

    -Ethan
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @DivergenceOnline in Tenkoku v1.0.0, the fog distance range is directly linked to the camera far clip plane, and then adjusted from there with the "distance fog" setting under Atmospherics. This isn't very flexible, so if you need to adjust these variables in the code you can do so by opening the TenkokuModule.js file and searching around line 1631 for the following...

    Code (CSharp):
    1.     fogDist = (1.0/useCameraCam.farClipPlane)*(0.9 + fogDistance);
    2.     fogFull = (1.0/useCameraCam.farClipPlane)*(0.9 + 0.0015);
    you can set the distance of the fog directly by changing the first line to be 1.0/(distance). so for example if you wanted to set the fog end distance to be at 6km, you would set it to be 1.0/6000.0.

    Code (CSharp):
    1.     fogDist = 1.0/6000.0;
    And for a little more control of this you can link it back to the tenkoku distance fog setting (so you can control it from the ui) like the below example... just replace the 6000.0 with your max distance range for your project...

    Code (CSharp):
    1. fogDist = 1.0/(Mathf.Lerp(0.1,6000.0,(fogDistance/80.0)));
    In order to set the near distance you would simply set the fogFull setting on this line to be a normalized distance of the fogDist setting. so at 6km end distance, if you want the fog to start at 3km, you would set fogFull = 0.5; or if you wanted it to just start where the camera is you would set fogFull = 0.0;.

    This has all been updated since 1.0 of course, and fog start and end distances can now be directly set in the tenkoku ui for easier control.
     
    Last edited: Sep 15, 2015
  6. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Could you just tell me what to
    Nope.

    This doesn't exactly look like the fog is starting at a distance of 0 to me.

    Here's the code:
    Code (CSharp):
    1. fogDist = 1.0/1000.0;
    2. fogFull = 0.0;
    Unity 2015-09-15 16-32-46-62.jpg
     
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I just took a second look at this and yes you're right! The fogFull setting is not quite so straightforward as it get's modulated in the shader afterward. Try the below instead...
    Code (CSharp):
    1. fogFull = (1.0/1000.0)*1.0;
    replace the 1000.0 with your max distance, and then the *1.0 determines how close to the camera the fog starts. *1.0 will start it essentially from the camera... whereas *0.0 will start it roughly halfway to the far clip plane. Adjusting it between 0.8-1.0 is probably you're best bet.

    That screenshot is looking pretty sweet! :)
     
  8. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Nope.

    No change.

    Code (CSharp):
    1. fogDist = (1.0/useCameraCam.farClipPlane)*(0.9 + fogDistance);
    2. fogFull = (1.0/2810.0)*1.0;
    Screenshot 2015-09-20 03.12.00.png
     
  9. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    is your far clip plane at 2810? I'd make them both the same just to be sure.
    Code (CSharp):
    1. fogFull = (1.0/useCameraCam.farClipPlane)*1.0;
     
  10. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    You can't make both lines that thing you just posted or it breaks the whole thing obviously.
     
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Sure you can. Did you try it?
     
  12. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
  13. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi there, I downloaded the demo from your site, and it looks absolutely fantastic. I particularly liked the night system, especially the Milky Way which is something I believe is missing in Time of Day. However, another thing I noticed was the impact on FPS; is there any way to reduce the impact on performance without losing the detail in the night sky? And am I right in thinking that on setting the graphics quality on entering the demo, it has no effect on the performance of Tenkoku? I'm in two minds whether to get ToD or Tenkoku, although I don't plan on getting either yet as I've just bought TerrainComposer, just nice to already have a decision made. Also, is it possible to add events to AI based on the time/weather conditions, similar to what UniStorm has done? Thanks.
     
  14. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Looking at PC demo I have several concerns: clouds are quite low quality, are you trying to keep the demo size small? Do you have hi-res textures for clouds?
    Also, stars movement. Usually, stars and the moon have different speed, it looks non natural in the demo. Is it possible to decrease stars movement speed or do they always lays on the same layer as the moon?

    Is it possible to have two moons of different size?
     
  15. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    (Tenkoko + Suimono + Content) is unfortunately heavy on FPS.
    Probably thats why the demo doesn't have both in.

    That said, they're both works of art and belong in an art museum ... just not an animated one ;)
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @jonfinlay Thanks for trying out the demo! There are some improvements and optimizations on the way that should improve performance a bit, I'll make sure to update the demo with these optimizations as well. To optimize performance you can turn off some features if necessary, such as aurora rendering, or you can lower the FPS of the built-in reflection probe (which contributes to overall performance impact quite a bit actually, depending on your scene). The current demo doesn't allow these to be turned off unfortunately. The Unity graphics quality screen probably doesn't have much affect on the demo performance, you're correct.

    There aren't currently any built-in functions for handling specific events, however you can access Tenkoku variables (current time/date for example) and then build your own events around that data. This would involve some coding on your end though.

    @montyfi The quality of the demo is pretty accurate to the real quality of the system. I'll look into adding a hi-res cloud texture option for the next update. The stars and moon do move at different speeds but their movement is accurate to real world movement (which is one of the features of Tenkoku, actually). If it doesn't look natural to your eyes than I'd say perhaps you've been playing too many video games :)

    With time sped up in the demo the moon should move slightly slower than the background stars. That being said you can set the moon to "simple" mode and set the moon position manually if needed, and same with the star movement as well. I'll see if I can get this setup so it's switchable for the next demo update.

    With Tenkoku being based on real world calculations, it isn't really meant to have a second moon object. It isn't impossible to add one, but you'd have to hack it into the system yourself, perhaps by setting your new moon as an offset to the existing moon.

    @mwituni I do have plans to show a demo with both Tenkoku/Suimono (hopefully soon!). I've worked so hard on getting the visuals to be top notch! Of course there's always room for improvement on the performance side. :)

    @DivergenceOnline Let me look on my end and see what it would take to get a working copy of the latest version to you in Unity 4.6... Not sure what it would entail on my end yet, but I'll get back to you later this week.
     
  17. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Any luck with that thing you mentioned?
     
  18. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @DivergenceOnline I've been looking into it, but the problem is that materials and prefabs are in a different format between 4 and 5. This makes it impossible to directly import and update. I'm looking into rebuilding from an old version in unity 4.6, but it's slow going since a lot has changed.
     
  19. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    I appreciate the work regardless, especially considering we already agreed that you'd stop supporting the 4.6 version. What I will say is that, I dunno if you're following the game but, since we launched this last campaign, it's getting some exposure and people are playing it. So when we make it known what technology we used, I'll simply mention it was Tenkoku and make no mention that it's a custom version. If I can get my hands on that working 4.6 version you're talking about now.
    Unity 2015-08-14 19-45-07-98.jpg
     
  20. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
  21. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    Awsome fog! Is that the Tenkoku for out of the box? I can't seem to get it to play nice with trees, grass or other objects.
     
  22. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    The image is the last supported version of tenkoku for Unity 4, which was 1.0. I got it to play nice with trees "sorta" by hacking the AFS billboard shader, but that's the only way I've found to do so and it isn't a perfect fix.
     
  23. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @DivergenceOnline - I hate to disappoint you man, but it looks like certain aspects of the skybox in the current version aren't movable back to Unity 4. This stuff is requiring some background Unity functions to decode the skybox properly, and it looks completely whack otherwise.

    @Licarell - I've been watching Jove from afar for a long time (though I'm not a customer) :) Perhaps sometime in the future I can move Tenkoku to work together with Jove.

    @Tovrin - grass/tree billboards will work with fog BUT the shaders used need to write to the Unity depth buffer. Depending on which assets you use you may need to edit the shaders to do this.
     
  24. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    That's a shame.

    well maybe at least you can help us fixed a different demon we've had for a while which it sounds like even people using your U5 versions could benefit from.

    This is what we have in the afs billboard shader to apply tenkoku light to tree and grass billboards.
    The problem is that the billboards still turn out incredibly dark unless you jack the tenkoku sunlight up to 2.75. I'd prefer to not have that much sunlight in the game, so if you could tell us how to link it better it would be appreciated.

    Code (CSharp):
    1. fixed4 frag(v2f input) : COLOR
    2.             {
    3.                 fixed4 col = tex2D( _MainTex, input.uv);
    4.                 col.rgb *= input.color.rgb * lerp( ( _AfsAmbientBillboardLight.rgb ), fixed3(1,1,1), input.color.a );
    5.                 // fade out billboards
    6.                 col.a *= input.fade.x;
    7.                
    8.                 //col.rgb = lerp(unity_FogColor.rgb, col.rgb, input.fade.y);
    9.                
    10.                 //clip(col.a);
    11.                 //col.rgb *= 5;
    12.                 col.rgb = lerp(tenkoku_backgroundColor.rgb* _Tenkoku_Ambient * 30,col.rgb,col.a);
    13.                 return col;
    14.             }
    15.             ENDCG
     
  25. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @DivergenceOnline - You should be able to gain access to the current tenkoku sun color (which is broadcast globally) just by adding a reference to it in the shader before the fragment section...
    Code (CSharp):
    1. float4 _TenkokuSunColor;
    Then add it into the final color mix with the appropriate multiplier that you think is best for your scene...
    Code (CSharp):
    1. col.rgb = col.rgb * (_TenkokuSunColor.rgb * 2.75);
    2. col.rgb = lerp(tenkoku_backgroundColor.rgb* _Tenkoku_Ambient * 30,col.rgb,col.a);
    3. return col;
    This way you won't have to increase the sun lighting in the system itself in order to brighten your billboard, you should be able to just adjust the "2.75" multiplier until you find the sweet spot.
     
    Last edited: Oct 7, 2015
  26. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    I'm using AFS as well. Would you be able to let me know how you fixed this?

    EDIT: Oops ... I should have just looked a bit further.
     
  27. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    That results in totally black billboards. And I could tell by looking at it that it would since all the current floats went after the frag and not before it.

    Well the game's on Greenlight right now and getting a huge amount of positive praise, so I wanted to give Tenkoku one last shot before I had to give up on it.

    Other people who already have your unity 5 versions are asking me for help on your own thread... Like I'm the closest thing to "getting it to work" that anyone has seen, so that tells me something is fundamentally wrong.

    To keep using it, it's a choice between the game being too god damn bright and mildly hurting your eyes, or having tree billboards that are black. That, and the fog stuff still doesn't work, and both problems I have are because after 16 months you'd still rather go back and forth like this trying to give proxy instruction to a non-programmer than remote-into one PC for five minutes, stick your head in the shader(s) and make the tweaks yourself.

    So what's it going to be, yay or nay.
    http://steamcommunity.com/sharedfiles/filedetails/stats/530659232
     
  28. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @DivergenceOnline Good luck with your project.

    @Tovrin If you're still having tree/billboard issues send me an email at konnichiwa[at]tanukidigital.com and we'll try and get them worked out :)
     
  29. ArrMeeR

    ArrMeeR

    Joined:
    Aug 27, 2014
    Posts:
    3
    Hi,
    How can i do Tenkoku multiplayer? If i will change weather other players cant see it
    Please help! I need fast answer
     
  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
  31. ArrMeeR

    ArrMeeR

    Joined:
    Aug 27, 2014
    Posts:
    3
    Is there any other solution? I am using Photon
     
  32. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Above is the built-in scripting solution. There might be another way, but I don't know Photon. How do you sync your other scene objects?
     
  33. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    Loving this asset, however I am running into Extreme frame-rate slow down, like 1-2 frames per second. Have followed the scene setup in the documentation. Area is super large about 3km squared. Any idea what is slowing everything down? I killed off any water to see if that would make a difference. Made sure camera is on forward lighting (tried both). Also the clouds are not showing up no matter what I try. using Unity 5 Pro. Please advise.
     
  34. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @davidhughes3d The first thing I would suggest for performance is to change the settings for the built-in reflection probe. This is included as a "convenience" but in some cases it may cause unnecessary performance hit. Go to the "configuration" tab on the Tenkoku object and try setting the 'Reflection Probe Fps' setting to 0. This should turn off the probe update. If you still have performance issues you may want to turn off the aurora rendering, as well as the star rendering (that is, if you don't need them).

    1-2 fps sounds incredibly slow though. a 3km view distance really shouldn't make much difference in performance. Are you getting any errors showing up in your console?
     
  35. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    how is the performance like ? i got 11 fps on the webplayer demo, i worry this make a complex scene much heavier. still hesitating between Tenkoku and time of day
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Damien Delmarle I just responded to your email.

    For those in the forum I'd be interested in hearing what kind of performance you all get when running the webplayer demo. While my dev machine (PC) is pretty hardy, it's far from being an ultimate gaming machine. When running the webplayer I get a consistent 55-62 fps. Playing the download I get solid 60.

    demo can be played here:
    http://www.tanukidigital.com/tenkoku/demo/
     
  37. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Bump! Anyone interested in reporting their webplayer performance?
     
  38. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    731
    Hi chingwa,
    on my old home pc I get about 20 fps (not bad):
    - GeForce GT 720
    - Core2Duo E6400
    - 3 Gb ram
    - Windows XP
    - Firefox 41.0.2

    My office PC: 57-63 fps
    - GeForce GTX 770
    - Core i7-4770K
    - 16 Gb Ram
    - Windows 8.1
    - Firefox 41.0.2

    Cheers

    Max
     
    Last edited: Oct 20, 2015
  39. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
  40. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Hello All,

    I'm happy to announce that Tenkoku version 1.0.7 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    There have been a number of speed improvements and bug fixes in this release. Notably, the night/star rendering system has been rewritten for better performance. The old system relied on using a particle system, and while the visuals were really nice, the performance requirement of this was dragging down the whole rest of the sky rendering system. With this update everyone should notice a marked improvement in performance. Note that because of the above changes in the star rendering system, you can no longer change the size of stars or constellations.

    In addition to the above there have been a number of other fixes with rendering, stuttering, and other various errors, as well as the inclusion of higher resolution cloud textures. With all of these bugs out of the way I'm planning on focusing on some feature improvements for the next update, with a particuar emphasis on improved weather automation and effects.

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!

    All the best,
    Justin Kellis
    Tanuki Digital


    ------------------------------------------
    RELEASE NOTES - Version 1.0.7
    ------------------------------------------
    WHAT'S NEW
    - Performance optimizations should bring improved framerate boost.
    - Added C# SendMessage support for timeCompression, autoTimeSync, autoDateSync, and autoTime variables.
    - Updated UI, can now click on category bars to open/close categories.

    CHANGES
    - Rewrote star rendering system for better performance.
    - Added higher resolution cloud textures.

    BUG FIXES
    - Fixed Sky/Atmospheric stutter issue when used with UFPS (and some other 3rd party controllers).
    - Fixed positioning error with galaxy rendering accuracy.
    - Fixed Atmosphere settings no longer fades star/cloud visibility.
    - Fixed rain/fog combining issues that appeared in some scenes.
    - Clouds now respond properly to wind direction changes.
    - Removed code that defines camera depth setting. Was causing issues with Suimono and elsewhere.
    - Fixed rendering error with clouds rendering on top of transparent particles and effects.
    - Fixed Aurora rendering errors (on Mac) causing 'pink' aurora rendering failure.
    - Fixed camera error tracking error when switching between scene cameras.
    - Fixed Light culling caution error due to too many layers.
     
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I should add that it's highly recommended to completely remove the current version of Tenkoku before installing this update. This is due to some fundamental changes to the night/star rendering system.

    To uninstall make sure of the following...

    1) remove the TenkokuSkyFog and TenkokuSunShaft effects from your main camera.
    2) delete the Tenkoku DynamicSky object from your scene.
    3) delete the Tenkoku folder from your project.
     
  42. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    The 1.0.7 update has been submitted to the asset store. I assume it should be ready and up on the store later this week.

    Also, @sjm tech and others, I've updated the webplayer and downloadable demos with the latest version and they should run much faster now. If anyone has time to test them out and post updated fps I'd appreciate it. :)
     
  43. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    731
    Sure!
    First impact...big boost of performance!

    on my old home pc now 46-52 fps (before 20):
    - GeForce GT 720
    - Core2Duo E6400
    - 3 Gb ram
    - Windows XP
    - Firefox 41.0.2

    At the office ...tomorrow!
    - GeForce GTX 770
    - Core i7-4770K
    - 16 Gb Ram
    - Windows 8.1
    - Firefox 41.0.2

    Chingwa...an impressive work!

    Cheers

    Max
     
    chingwa likes this.
  44. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
  45. Tempetek

    Tempetek

    Joined:
    Jul 28, 2014
    Posts:
    6
    Hey chingwa,

    The last version of Tenkoku broke the stars rendering system. Before, I was able to only renders the stars without the galaxies, and it was fitting perfectly with my game. Now, stars are rendered along with the galaxies and thus removing the galaxy rendering is equal to removing the stars. I don't know if this is because I didn't update Tenkoku the right way, but I hope you can do something for this, I liked the old stars rendering system.

    - Tempetek
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Hi Tempetek,

    Yes the star rendering system has changed, and you're correct disabling the galaxy now disables the stars as well. It looks like that's an oversight on my part. However you can still control the stars/galaxy rendering separately, just make sure you have the stars and galaxy both enabled, and then you can set the brightness of the stars to the level you prefer, and set the brightness of the galaxy to '0' so that it doesn't render.

    The stars were one of the largest contributers to poor performance which is why I switched them. I'll have the galaxy disabled feature fixed in the next update so that it doesn't automatically disable the stars as well. LEt me know if you still run into any trouble with this.
     
  47. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    And just in case there was an install error, I do recommend completely removing the old version of Tenkoku before installing the latest version. To completely uninstall you can do the following...

    1) remove the TenkokuSkyFog and TenkokuSunShaft effects from your main camera.
    2) delete the Tenkoku DynamicSky object from your scene.
    3) delete the Tenkoku folder from your project.
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    For those who don't follow the Gaia thread I was asked by @ZenMicro about including a distant heat shimmer effect, and since it was something I had on my list of features to implement "in the future" I thought it was a good excuse to to take some time and work out over the weekend. Below you'll see the first pass. Currently you can control various variables, such as strength, speed, depth, scale. I do intend to hook it into an internal 'temperature' attribute, so that it can automatically generate as the seasons get warmer, and the day temperature rises.



    The new effect will be included in the upcoming 1.0.8 update.
     
    ZenMicro likes this.
  49. ZenMicro

    ZenMicro

    Joined:
    Aug 9, 2015
    Posts:
    206
    You should make it more obvious i had to really study this picture to realize it was a gif lol :) What settings does it have? distance from camera Start, End, Intensity etc?

    Glad to see this effect wasn't too hard to pull off in such a short time.
     
  50. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @ZenMicro Yeah it could stand to be a bit more obvious. It is linked to the temperature adjustment, so the higher the temperature the more obvious it will become. I can make some more adjustments and look into the 'evaporative' type effect in a future update :)