Search Unity

Tenkoku - Dynamic Sky

Discussion in 'Works In Progress - Archive' started by chingwa, Jun 24, 2014.

Thread Status:
Not open for further replies.
  1. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    The clouds looked imposter-based, a-la Harris, which you could fly through but did have the problems particle based clouds can suffer from but they're the nicest dynamic particle based clouds i've seen as an asset for Unity for sure. This is pure speculation on my part however
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Becoming - I've done a little bit of testing with the light cookie technique and it seems like it could be feasible. I haven't done any image rendering for it though, so I can't speak yet to what you and lazygunn have said about performance/accessibility.

    Unfortunately, I don't think it's going to be feasible to do true volumetric, where you can fly through the clouds ala flight sims etc. At least it isn't setup that way currently, and I haven't had much luck so far translating the current cloud system into that. I still have my fingers crossed that I could adapt it, but this will require some specific further testing. The current setup is tweaked specifically to look good from ground level, and it starts to get all kinds of weird when moved outside it's projection :D

    it will work fine in dx9... actually in it's current state it works better in dx9 than dx11. The final product will of course be dx11 compatible as well.

    lazygunn - The cloud system indeed is a particle-based imposter system. The implementation is actually simpler than Mark Harris' version, and relies mostly on artistically authored texture maps that feed into specific lighting modulations in the shader. It works well within the current limits (ground-based viewing).

    Most of the systems are now in place and I'm going through looking for compatibility issues and setup-specific problems. The dx11 depth buffer needs to be addressed for example, and forward rendering for these complex shaders always causes innumerable issues. I've been thinking of locking it to deferred rendering only... I don't know how much of a problem that would be for users?
     
  3. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    It would be a rather large issue for all Unity free users aha.. but I think Unity 5 is going for a full deferred renderer overall? Might be worth looking into.

    I sent you what may or may not be a useful PM thingy, vastly different cloud approach but might be useful - pretty much directly in line with that pm, which just occurred to me is iq's clouds demo on shadertoy, iq's demo is of course useless as-is but my link and looking at it's inspiration (and probably an email to the creator as he's no longer updating) might really help
     
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    true that, but for Tenkoku I'm only concerned with Pro users, at least initially.

    I can't seem to ever load that shadertoy website. I've tried in 3 different browsers and it just spins, or crashes. pfft. I'm sure I'm missing out, but I don't know what the deal is.

    I got your pm, thanx, I'm digesting a little and will respond after :D
     
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Try it with Chrome, to be honest chromes the only browser i've had success with but it's well worth it. It's all pixel shaders in webgl using stuff like raymarching to create all kinds of wizardry with minimal code - in terms of rasterised rendering like Unity it's not usually remotely relevant as they're entirely different paradigms, but there's existing work for mixing this kind of approach for volumetric participating media like clouds with Unity's rendering. The creator of which themself (linked in pm) will point at iq's demo for an improved technique for the actual recreation of clouds although they do great Unity-specific things that iq's shadertoy demo is not remotely catering for.. I suppose a good result is to substitute the old cloud formation idea with iq's but use the actual implementation into Unity roughly as it stands.. perhaps substitute their approach with a 3D texture although this would, i guess, require an significantly larger amount of memory
     
  6. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Deferred is fine, as stated Unity5 will be deferred only. What about it being better in DX9? I know all new projects in Unity are now DX11 as standard, what will happen in Unity5; will DX9 still be an option?. By the time Tenkoku is released, will it work just as well in DX11, or even be an improvemnet on DX9?
     
  7. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Imposter systems really have their roots in dx9 is the thing here, they've been quite ubiquitous for particle clouds since early 2000s, so dx11 brings new considerations, and if the heavens open and Unity gods kiss us, Unity 5 brings servicable OpenGL to the masses, and more considerations - and THEN there's the fact you simply cannot ignore GPU computing for any tasks that can be parallelised and fancy using a giant bunch of compute power covering an area of your video card that isn't being used so much at the moment and probs is worth capitalising on very very soon or be behind the pack (Nagging all asset makers i communicate with at the moment 'look, its not going away!').

    I do like this impostor approach especially if the atmospheric scattering and clouds work seamlessly with Suimono but i'm definitely giving subtle bumps to a volumetric approach and the sources to refer to to get something in there as painlessly as possible. I'm not really that keen to share a bunch of stuff to all as i've built up communications with people who I think are creating great things for unity that could benefit hugely from some of the digging i've done and there are some asset developers perusing this board who I just have misgivings about and I don't think they're particularly healthy to the community while stringing behind them sparklyness crazed interested parties who will jump on a zeitgeist or conveniently supplied method for a buzzword technique and just knock something out. Kinda takes attention away from the hardworking folk trying to really knock out a great product and whats more provide fantastic customer service which really people can stuff their fancy features for if they can't use them anyways cause the support is cold and full of redirection

    This is why I think chingwa is tops, he gave fantastic support throughout the Suimono 2 beta, which I got very involved with, and I'll be getting very involved with again when it hits release, and i'm going to get very involved with Tengoku also, when I grab a copy, as well as shoot some emails around and collate some information because I think I can count on some generosity from likeminded coder folk to offer some stuff.

    Basically Chingwa expect another PM! aha
     
    Mr-Logan likes this.
  8. JohnParask

    JohnParask

    Joined:
    Jul 7, 2014
    Posts:
    323
    Looking awesome +1
     
  9. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    lazygunn - chrome... hmmm. I've avoided chrome like the plague, but I've also noticed that somehow when I wasn't looking chrome became the number one browser on the internet... by a huge margin! o_O I guess I'll have to jump on the google bandwagon.

    I can tell you that true volumetric clouds are not in the cards for the 1.0 release... it would mean me going back to the drawing board and my time-frame won't allow that now. But later this year a volumetric update might be possible... I'm not discounting anything. And who knows, Unity 5 might bring a true revolution int his department.

    whippets - when I say dx9 is better than dx11, I just mean that I haven't addressed the unique dx11 differences yet... I've done all development with dx9 but as a lot of the system relies on depth buffer usage, switching to dx11 reveals how different the depth buffer is beween the two. I should be able to address this soon, and once it's released on the store you won't notice any difference between the dx9 version and the dx11 version.

    As for having rendering improvements in dx11... yes I can see this happening in a future update, specifically with cloud rendering and performance. as noted above though, what I'm targeting at initial release is feature parity.

    GreekStudios
    - :)
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi becoming!
    i am not sure if you are right about this...
    first: i can not imagine that updating one single texture every frame should be more expensive than generating and rendering shadowcaster meshes. but i might be wrong about this.
    second: using shadowcaster meshes would limit cloudshadows to the real time shadow distance – which you usually would set rather low to speed up rendering. cloudshadows however are very large scale phenomenons and should be visible over a very long viewing distance.
    thirdly: transparent shaders do not receive real time shadows but are effected by light cookies.

    lars
     
  11. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Hey lars :)

    Yeah, think you are right, however i experienced that a lightcookie, even of a very small texturesize impacts performance a lot, using setpixel isn't cheap either. But you are right, especially when considering the shadowdistance. I should have put a "maybe" in my statement :D
     
  12. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Through my experience with Suimono, where I populate multiple light objects with 32 alternating cookie textures at a good 30fps (to simulate caustics) the actual assignments and switching do not have any noticeable performance hit. However, generating a texture programmatically to simulate cloud shadows will almost certainly have a performance hit... the only question is how much?

    I'll be working up an example of this soon to see if it's feasible. The light cookie method seems like the best tradeoff for all the reasons lars has mentioned :)
     
  13. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    I agree, though i remember putting a cookie on directional light for cloudshadows was slowing things down a lot, 600fps to 120fps, only using a very small cookie (32px) made it perform better. Since clouds are casting very blurry shadows, a small cookie size might not be a problem. 32px wont be sufficient for nontiling cloud distribution but keeping the cookie as small as possible generally is a good idea.
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there!
    well, you might be right as far as forward rendering is concerned as it adds one more texture look up to the lighting function which is called per mesh/material producing heavy overdraw.
    but when using deferred lighting which is done in screen space i can hardly see any difference.
    so i will put a "may be" in front of my statement as well!

    lars
     
    Last edited: Jul 24, 2014
    Deleted User likes this.
  15. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    My info was based entirely on the complaints the creator of Nuaj had about Unity's thick-at-the-time inability to deal with light cookies well, hope this has changed since. And certainly wasn't expecting or suggesting a volumetric system for this just yet! Or in a mid future or expected update, just maybe an avenue to explore as the product matures and I hope is a success

    And yeah! I used to be rather pro-google and I still find a lot of its initiatives admirable (recent huge fan of Cardboard and just read they were a founder of the Singularity Institute, who knew?) but there's a spooky ubiquity about them that makes me feel like no matter where I am or what I do, I will not be able to escape them
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    This page needs a screenshot.... :)

     
  17. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Can't wait for its release.

    Didn't see it mentioned but will this support seasonal shifts in day/night cycles and weather patterns using latitude/longitude position (like the aurora system).
     
    Last edited: Jul 25, 2014
  18. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    @chingwa
    Your tool works with a spherical world? A procedural planet?
     
  19. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Eclipses - great (but moon a little small).

    If you're giving us eclipses (you awesome genius), you must give us functions to predict when eclipses will occur in the future at various latitudes. Being able to say that on a certain date an eclipse will occur, will make game patches and storylines far superior.
     
  20. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    John G - Yes there is seasonal shifting. Days are shorter in the winter and longer in the summer (depending on latitude) and the sun position changes as well according to time of year. The weather can either be assigned explicitly or you can leave it up to the automatic generator(which is still a W.I.P. at this point), which does take into consideration season and latitude.

    ZJP
    - Well, yes and no. It will work on a spherical world, sure.... but it isn't going to move smoothly in and out of an atmosphere, if that's what your asking. It really is more of a ground-based system, rather than flight or space travel.

    Whippets - Wha? the Moon is exactly the right size, which is why you get the eclipse :D If the moon is a little too small, you'll get the annular eclipse, and if the moon is really too small then you won't get much an eclipse effect at all. What you see in the total eclipse image is the external solar aurora becoming visible which is only possible during a total eclipse.

    The eclipses are all movements based... this is still being developed and I'm hoping to get the accuracy to a very small margin... to where you could look up an actual predicted future (or past) eclipse date at a specific location and time, punch those into the system and you will see exactly what you would expect.

    There is also the possibility of switching the movements to "simple mode" which gives you direct control over the position and phase, and just offset the moon until it is in front of the sun.
     
  21. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
  22. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Last edited: Jul 25, 2014
  23. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    This looks great! Are there any special considerations or features planned for integrating with IBL provided by other assets like Lux and SkyShop?
     
  24. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    This is so fabulous. I might sound a bit odd, but the fodder this would give to our lore and role playing is amazing! I can't wait. :)
     
  25. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    This does look pretty nice.
    I have been using Nuaj for quite a while, though not published with it.
    It can be very expensive to render, but can look very good, too.
    I'm wondering how expensive it is for your plugin as far as rendering/frame rate?
     
  26. LeakedDave

    LeakedDave

    Joined:
    Aug 26, 2012
    Posts:
    23
    Very cool, but you should support mobile.
     
  27. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I really like Nuaj and it's a massive pity some fixes for it with new unity features could improve performance enormously but the creator has moved onto bigger things. The main issue is a ridiculous costly readback that cost 7ms and a solution to that would be great - It's always going to be costly though and i'm really looking to Tengoku because it should hopefully integrate well with Suimono, making them a very attractive package (im hoping chingwa has plans to integrate - as i've been reading, an ocean shading is intrinsically linked with the atmosphere). Also I love the artiness of this much the same as Suimono, very art driven systems which is perfect for me
     
  28. T1Green

    T1Green

    Joined:
    Apr 2, 2014
    Posts:
    21
    ああ、本当空見たい!!! O(≧∇≦)O

    Hope to see more~
     
  29. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Thinking aloud, as is my wont, I wondered about volcanos - or to put it another way cloud emanation from a source. Would this be a possible idea?
     
  30. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Volcanoas are a bit of work, having a system in would be great but there are assets really geared around this kind of thing, which makes me remember that alpha doesnt always work well with volumetric systems, so that would be something id consider
     
  31. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    there is an EPIC volcano pyroclastic cloud modeling in the forum with an asset named next gen fluid particles or a similar thing. search for it. on the phone now cant search.
     
  32. majorcyto

    majorcyto

    Joined:
    Jul 31, 2014
    Posts:
    1
    Hey there Chingwa, just wondering how the progress is going.. this is really cool! ;)
     
  33. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Thanks Everyone,

    Sorry for the delay in replying here. I've been neck-deep in math and code and trigonometric rotations! Math is a beautiful beautiful thing and I hate it. :D The good news is that the position of the sun, moon, planets, and stars is now extremely accurate. Eclipses can be predicted very reliably by just entering relevant date/time/position info. Precessional movement is taken into account for all objects as well as all sorts of perturbance effects. [/geek mode]

    whippets and John G - . the image whippets posted is an annular eclipse, caused by the moon being at it's apogee point... Tenkoku will model partial, annular, and total eclipses of the sun. Currently it doesn't do lunar eclipses, but maybe I could work up a solution for this in the future.

    jzela - i.e. ibl integration... I don't have a solution for this currently. I'd be very open to hearing everyone's opinions on how a dynamic sky system could / should be integrated into an IBL setup like skyshop. There is direct lighting in Tenkoku for the sun and moon so that should work just fine in IBL, but there is currently no solution for IBL for ambient sky lighting.

    Don Gray - I'm making no real comments on performance until a little closer to release :D The sky system itself runs very fast, however those beautiful cumulus cloud systems do slow down the framerate (though you can control for quality vs speed in a slider). I'm working on getting more performance out of them and am pretty confidant It'll be acceptable for most projects.

    LeakedDave - Sorry dude, mobile support is not currently possible. (maybe sometime in the future.)

    lazygunn
    - Suimono 2.0 integration is under development... hopefully I can show some screenshots of them working together soon.

    T1Green - ありがとうございます。 More screens / video coming soon!

    r.e. Volcanoes - the cloud handling in Tenkoku is very specific and it would not be adaptable to emit from a specific source, for a volcano. There are other particle systems (for dx11) available on the store that would suit this effect better, as lazygunn and Pulov have mentioned. I have been thinking of expanding the weather system to incorporate more customization controls, like a weather-front based system... even possibly incorporating real-world weather data... and this type of system could possibly simulate a volcano type emission (though not as effectively as other assets) All this is definitely getting beyond the scope of the initial release however, so this will remain to clank around inside my head for a little while longer.

    majorcyto - thank you! above is an update. :)
     
  34. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Looking forward to more info on your developments!

    :)
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    i would probably prefer do not use cubemaps for ambient diffuse lighting but rather spherical harmonics (as introduced to skyshop in version 1.07 i think).
    to create the needed values passed globally to all shaders you could have a look at the cubemapper script that ships with lux (free and open source pbs shader framework on the asset store): it still renders diffuse ambient lighting into cubemaps but does it by creating SH first (5th order – whereas 3rd order must be enough...(otherwise you may run out of constants – max is 32 in some profiles like opengl, but you need some of those for your textures and other inputs of course) ).

    in order to support some kind of "skyrotation" you can have a look here:
    http://www.filmicworlds.com/2014/07/02/simple-and-fast-spherical-harmonic-rotation/
    much better doing it by script than in the shader (like skyshop) i would say ;-)

    to get you started you may have a look here:
    http://dickyjim.wordpress.com/2013/09/04/spherical-harmonics-for-beginners/

    lars
     
  36. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    More accurate stars and heavenly bodies, all I can say is YES.
    Looking forward to seeing how an in game navigational sextant will fare with navigation using sun, moon and the stars.
    Looking at making a naval sim so this system tied into Suimono will be a lifesaver.

    Will you be running a beta pre release?
     
    Last edited: Jul 31, 2014
    Teila likes this.
  37. wabuilderman

    wabuilderman

    Joined:
    Jul 30, 2014
    Posts:
    46
    First of... THIS COMPLETELY BLEW MY MIND INTO SPACE!!!!!!!!! this is the most amazing sky system i have ever seen.

    Second off, will there be a "sun position" so that I could use it with say, a sun shafts effect?
     
    Whippets likes this.
  38. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    SunShafts is a camera effect, so I'd guess comes from the main directional light which is a gameobject.
     
  39. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I posted a video i did using Fluidity and Nuaj some time ago that was a little mock-up of a fictional eruption of mount rainier, i dont know if it is epic but it may be that, as thats the one 'proper' volcano kind of simulation ive seen on the forums, and i dont know of any other asset than Fluidity that could do it as it's the only volumetric fluid simulation of high quality i know of on the asset store
     
  40. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Also, i'll second what Lars said, Lux would be a great place to find some inspiration for that kind of lighting and spherical harmonics makes more sense than cubemaps in wide dispersed 'participating media' (rather than solids) i think. It would account for light coming from the ground and suchlike also rather than a solution derived just from the atmosphere
     
  41. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    Having this automatically drive ambient lighting with spherical harmonics like lars and lazygunn have suggested would be amazing in my opinion!!! Instant buy from me if that happens.
     
  42. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    John G. - There won't be an open beta period before release (though there may be a very limited closed beta... the clock is ticking though! :D )

    wabuilderman
    - haha thanks. Tenkoku already incorporates a toned down sun shaft effect, however you could add your own on top of it by using the sun object as transform info.

    lars, lazygunn, jzela - Spherical harmonics sounds pretty interesting. I've spent a couple hours this morning looking into the links you posted, lars, and beyond... and my mind starts racing with the possibilities. There will be no diffuse lighting solution to start with, but I'd love to incorporate SH as a solution to this in a future update. I have my homework cut out for me that's for sure.
     
  43. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    It's great to hear that you're willing to take a look at SH. I think this type of functionality could be a real differentiator for Tenkoku!
     
  44. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    It would be great if some of these extras could be turned off or tuned down for older PCs. I know my customer base are not likely to be gamers with the highest spec machines - in fact the opposite is true XD
     
    Teila likes this.
  45. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Are we still going with this? Been quiet for a while now.
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Yep, It's still happening! I've spent the last couple weeks improving the cloud performance and integrating Tenkoku calculations into Suimono 2.0. It's going well, I'll have some more news on this really soon. :)
     
    John-G and Teila like this.
  47. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Does this mean the skies will be part of Suimono 2.0 as well?
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    No there won't be skies in Suimono, they will be separate assets. However I want them to work well together, thus Suimono will use some of the Tenkoku color calculations if it's available in your scene.
     
  49. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Great, as I think I'll be buying both :)
     
    Teila likes this.
  50. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    That looks really good. Can't wait until it's ready for release.

    Is there any way you could give us a "rough" estimate of how much it will cost. For instance are we talking 30-60 dollars, 100+ dollars, 300+ dollars, 500+ dollars lol.........just wondering. Thanks.
     
Thread Status:
Not open for further replies.