Search Unity

NordLake - Optimised water system

Discussion in 'Works In Progress - Archive' started by olix4242, Mar 6, 2016.

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

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Currently working on a Unity Lake Water shader system optimised for VR applications and fully compatible with Unity reflection probes and new image effects (Screen Space reflection).
    This will be a solution that can give you a realistic effect but will be many time faster than any other water rendering systems.
    First version of this shader will be focused on lake (calm) water simulations.
    This system doesn't use any transparent shaders or render targets, and it can really improove performance in any VR application that require water effects. It mostly relies on terrain depth maps, and can do also a refraction without any significant impact on CPU or GPU.






     
    Last edited: Sep 15, 2016
    Hawk0077, Mark_01, Alverik and 6 others like this.
  2. behemothentertainment

    behemothentertainment

    Joined:
    Jan 30, 2014
    Posts:
    22
    I had to question whether or not that was an actual picture or not! Very nice!
     
    JamesArndt and olix4242 like this.
  3. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It's a screenshot from unity ;)
     
    Mark_01, Alverik and Eric2241 like this.
  4. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Working on animated shore effect. Still have to work a lot.
     
  5. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    nice

    good work

    Norby
     
  6. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    This looks great! Any idea when it will be ready?
     
    olix4242 likes this.
  7. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Not sure yet. I'm almost in a final stage on programming this, but for a moment I had to stop working on it because I had some urgent works to do right now. I think I will wait for a stable Unity 5.4. Also, I will need some time to write a documentation and finish a decal system (but a decall system could be maybe introduced after first release). For now I'm concentrated on making it easy to use, because it uses it's own baking system for creating textures needed for placing lakes onto a terrain or mesh.
    For now it works like this:
    -You place a standard plane at a level and in a zone where you want your lake to appear. (so that it covers all surface)
    -Set a Terrain that holds your lake (or multiple terrains or objects)
    -Add a Lake Baker Component and choose a resolution of baked textures.
    -press a button "Render maps and create lake materials" (takes one second)
    After that a script will create all neccessary maps, and create a lake material.
    After creating material, you can move your lake plane, or use another object as a surface of a lake. Also, you can use more planes and a lake will be always casted on them (as long as you use correct lake material). After rendering, you can also move lake down and a lake shore will follow correctly your terrain. All lake materials are world space materials and there will be different shaders for those materials. One for lake itself, one for decals (plants floating on water), and various ripple dacals (to be placed on sides of objects holding that are in touch with water).
    This simulation isn't ment to be a physically correct simulation. But a higly optimised visually good looking simulation.
     
    Alverik likes this.
  8. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    Thanks for the info - that sounds awesome. I will definitely be keeping a watch on this :)
     
    olix4242 likes this.
  9. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Working on some nice updates:
     
    Alverik, jdraper3, mk1978 and 2 others like this.
  10. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Some new changes done to NordLake:
     
  11. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Looking great, any date for a release and expected price? Is there any early access beta program?
     
  12. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    I second that. The setting for my game is a lake, and I've been using a very heavy water solution - this looks really amazing! If you need anyone to beta test, I'd be happy to help :)
     
  13. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    looks great, would love an expected release date
     
  14. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
  15. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    101
    Looks great - especially happy that you are focusing on VR! Will this support single pass stereo rendering? Can't wait to get my hands on this...
     
  16. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Oh yes please you have to support single pass stereo rendering that is the future of unity VR. No other waters support that feature yet.
     
    rocky1138 likes this.
  17. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, it should support single pass stereo. Atleast, in theory, it's not tested yet, but there is no any known reason why it shouldn't work.
     
    Alverik likes this.
  18. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Hi, I still don't have any definitive release date as there is still a lot of work to do (optimising code, designing editor interface for clarity and simplicity of use, writing documentation). Core itself is almost finished, but it lacks features that a commercial plugin should have. Right now I'm trying to experiment with a support for flow maps.

    For those who are interested on testing, you can apply for alpha/beta testing by writing on: olix@iol.it
    Please write few lines about yourself, and send eventually some references of your work.
     
    one_one likes this.
  19. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have received some requests for betatesting, and I will respond to You all as soon as it starts. And it should be soon.
    In a meanwhile, another test:
     
  20. howardt12345

    howardt12345

    Joined:
    Jan 4, 2016
    Posts:
    31
    Woah this looks amazing
     
  21. Fenris2

    Fenris2

    Joined:
    Aug 25, 2014
    Posts:
    61
    Any news on how goes progress? :p
     
    olix4242 likes this.
  22. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm almost ready for beta. I'm a little bit late in development as I've wanted to add some new features. one of them is Flow Map painting, that can be great for supporting waters as rivers. Flow Maps are maps that contain vector information about flows. They contain information about a direction and speed of a water flow. There are many things that I want to implement, and flowmaps are good step to make this water system light and more dynamic. But this requires some more thinking about workflow and UI, as everything has to be as intuitive as it can.
    That's why I will probably enter an alpha testing before promised beta - as I want some inputs about workflow from users. I say alpha, because some things will not be polished as I would like them to be ;)
    Here is a screenshot from UI as it is now:
    NordLake.jpg
     
  23. Fenris2

    Fenris2

    Joined:
    Aug 25, 2014
    Posts:
    61
    Interesting, looks quite cool from a visualization perspective.

    From a game use perspective I have a few questions about your thoughts on. . .

    1) What happens when a player goes under water. I.e. underwater effects?
    2) Player puts a boat a on a lake with a lake material. How would one handle "cut out" of the water from the hull? I.e. the hull is below the water surface yet water should not appear in the boat hull, just around it. I suppose that leads to 2a) the fun-fun world of buoyancy.
    3) Can it support water at multiple height levels efficiently in one scene. I.e. a lake on a hill, but in the valley down below there is a river.
    4) Does it specifically require unity terrain below it to operate. Seems to imply after material is generated it would be usable on any object? I ask because I am pretty stoked about Terrain Engine coming out for indies at the end of the month. As a voxel renderer it is not likely to produce unity terrains, but rather just meshes.
     
    Last edited: Oct 19, 2016
  24. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Doesn't look like its suitable for mobile devices with a shader that complex, do you have any plans to offer a strip downed mobile version? Also how does the performance compare to the Unity water system?
     
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    For now nothing :) I will work on this part in later versions (but I have some ideas on how to do it in optimised manner, also with a transition from wet to dry).
    It's something that I'm undecided how to do. There are two methods in option:
    -mesh method. Isn't hard to implement but requires user modelled mesh for cutout.
    -alpha cutout. Would allow dynamic cutout, but with downside of loosing some performance. Not sure if this is a way to go.
    Yes. There is no any problem of making multiple level surfaces, as long as they are flat.
    No. There is no need to use unity terrain, it works fine with any mesh (just has to be filtered by using Layers).
     
  26. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    That isn't planned for now. This has to be really light system for VR and I don't want to add too many things that will simply slow down everything.
     
    Alverik likes this.
  27. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I will probably make also a mobile version (for modern devices). But idea behind this system is that it was made for VR and VR ready hardware. It is a complex shader that requires good graphic card capabilities, but on modern hardware it is really lighting fast. Only one drawcall and no render textures. It is completely baked, so it has a performance that overperforms unity water many times. Rendering speed of a same complex scene with or without Nord Lake doesn't change.
     
    eaque and Alverik like this.
  28. howardt12345

    howardt12345

    Joined:
    Jan 4, 2016
    Posts:
    31
    Hmm, if it's just one drawback call, then it should work fine with mobile devices, right? If this definitely outperforms unity water many times and looks much more stunning compared to Unity's water system, that would be absolutely amazing ans I'm sure that a lot of mobile VR developers would love to take advantage of that :D
    This is definitely a very good idea. An Alpha testing phase would allow you to get user input from other people targeting various platforms and optimize it as much as you can. Just one question: Would Alpha testers need to pay for this asset once you've released the asset on the Assetstore?
     
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    I'd vote for keeping this purely for desktop and surface water only (and then make it the best looking water surface ever),
    or at least focus on that, before adding lots of "extras".. (even Ceto seemed to have problems with underwater system)

    For boat cutout, maybe something like this could work,
    http://wiki.unity3d.com/index.php?title=DepthMask
     
    one_one and olix4242 like this.
  30. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Well, actually no - because it all depends on supportd mnumber of texture units and instructions count. Another problem is that you can get best results for realistic water with HDR and Linear colorspace. On a desktop this isn't a problem, but on a mobile you get problems with VRAM size.
     
    Alverik likes this.
  31. howardt12345

    howardt12345

    Joined:
    Jan 4, 2016
    Posts:
    31
    Ahh good point
     
  32. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, this maybe could be a solution. I have to see this is compatible with all workflows (deferred and forward). And I have to understand if it's easy to use. Also, another concern si how it behaves with image effects. I want that any solution in this plugin is compatible with all image effects.
    I have tried a solution by using stencil buffer, but it isn't compatible with some plugins and shadowing system.
     
  33. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I want to know what you future users think of my workflow for painting flowmaps (and eventually also other type of maps):
    -at this moment I'm not supporting a paainting in a scene view (as you usualy would do with other plugins). NordLake requires use of play mode and working in Game Window. Why? Because I intend to make this scripts compatible with VR Devices (like VIVE controllers) that work only in play mode. Also, it could in future use physics and that also requires Play mode (and also introduce a compatibility with my Physiq Painter plugin in developement).




    Also, nord lake features a script that can mimic standard scene view navigation in Game View. This approach will also simlify porting from static flowmaps to dynamic in realtime (with a help of few shaders).
    Only step that is required is that you eventually have to turn off your main camera scripts for movement before painting.
     
    Alverik likes this.
  34. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    Hello OliVR. Let me know if you need a tester for this one. Best.
     
  35. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Actually, it works fine. I have to test it yet with all possible cases, but for now looks like it works really fine.
     
    Alverik likes this.
  36. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Good news, looks like I can get it to support mobile. I'm testing it on samsung Note4 and it works really great - overall, I get quite good performance. I had some precision problems with normal maps, but I've found a way to correct them.
     
    Alverik and one_one like this.
  37. howardt12345

    howardt12345

    Joined:
    Jan 4, 2016
    Posts:
    31
    Oh sweet! I'll test this out with Google VR to see how good the performance is with mobile VR.
     
    olix4242 likes this.
  38. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I've been creating VR environments past couple years and hard to get a good water with real time reflections working properly. There's always something wrong there or make you see cross eyed hard to describe but never looks right. Can you create a fallback to a reflection probe as the water reflection?

    Calm Water works off a cubemap and Aquas works off a reflection probe as the "fake" reflection in the water and this is what I have found out to be the best since real time water reflections never work in VR. The reflection probe as the fake reflection works and looks the best be nice to have this option as a fallback for us VR creators as well.

    If you need a VR beta tester I can help there as well. Thanks.
     
    olix4242 likes this.
  39. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It already supports light probes (best for stereoscopy if used in Box projection mode). Also, from my tests on gtx 1080 and new unity SSR on Vive, it works really well with realtime reflections (performance is better with NordLake+SSR vs. other water systems that use two cameras for plane reflections/refractions). Nord lake doesn't use any transparent shaders or render targets, to assure complete compatibility with all sky, particles, fog and lighting systems or image effects that many times could create problems with transparent surfaces.
     
  40. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Some new approaches on water shader by using texture depth maps. nordlakenew.jpg
     
    eaque, Mark_01, Alverik and 7 others like this.
  41. howardt12345

    howardt12345

    Joined:
    Jan 4, 2016
    Posts:
    31
    That looks pretty sweet! Can't wait to test it out :D
     
    JamesArndt likes this.
  42. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Wow this is outstanding looking. Did you manually paint in the "wetness" look where the shoreline darkens or is that an effect of the shader itself?
     
    olix4242 likes this.
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    That is a shader feature ;)
     
    eaque, Mark_01, Alverik and 1 other person like this.
  44. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Wow very cool. This is looking like a definite purchase. Tasheren Water was just kind of lacking for something like lakes and rivers (though it looks great as an ocean body of water).
     
  45. Fenris2

    Fenris2

    Joined:
    Aug 25, 2014
    Posts:
    61
    Obviously a fair ways off. But what are your thoughts regarding rougher conditions? Ocean waves? And, of course the "ever dreaded" shore/ocean interaction?
     
  46. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Lately, I have done some experiments with larger waves and I'm up to something cool that could work nicely. But, it would require use of dx11 shaders and a lot more complex shaders. For now I don't intend to support ocean system, but I did those tests just to understand if this system can be upgraded later. (It's always better to plan ahead eventual extendibility).
     
    eaque, Alverik and one_one like this.
  47. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Beautiful!
     
    JamesArndt and olix4242 like this.
  48. Fenris2

    Fenris2

    Joined:
    Aug 25, 2014
    Posts:
    61
    Just thought I would give a poke to see how things were coming development wise.
     
    olix4242 likes this.
  49. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    For now, I'm hardly working on this solution, and some 'sister' solutions that came spontaneously (spoiler: mega-city shaders for city landcapes) that will hit the store probably after a new year. As they all use quite same approach, i'm working on a "platform" that will enable future developements.
     
  50. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240

    Looks stunning. Would be delighted to beta test. I have a question though: how were the clouds made? I am looking for a convincing solution, similar to those from Vue d'Esprit.
     
Thread Status:
Not open for further replies.