Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Water+ (for Unity Free and Mobile)

Discussion in 'Assets and Asset Store' started by ilya_ca, Feb 8, 2013.

  1. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274

    Released on the asset store!

    An advanced water system for Unity Free and Mobile, that actually looks better than Unity's Pro water. It has reflections, refractions, fast anisotropic specularity, and animated caustics. You get a lot more features that the built-in Unity's Pro water doesn't have. Unlike other products, Water+ has been created with mobile devices in mind and it has been thoroughly tested.
    It's stunning!

















    List of features:
    • Created for use with Free and Mobile versions of Unity. Supported platforms are: PC, Mac, iPhone, Android and WebPlayer. Flash is currently unsupported.
    • Refractions without the use of RenderTexture that work in Unity Free.
    • There’s no need to have geometry (terrain) underneath the water – the system will nicely hide the edges of the terrain and simulate waters of different depth in undefined areas.
    • Lightmap tool, that updates an existing lightmap and makes the shore look actually wet. The resulting lightmap is saved in an HDR .EXR format that preserves all of the lighting data (as in the original Unity’s lightmap).
    • Animated caustics.
    • Flowmaps support. Flow map tool that will adjust the flow speed, according to the terrain’s shape to make the flow look more realistic. Shader makes use of a fast optimized flowmaps algorithm that animates normals, refractions and foam according to the flowmap.
    • Fast anisotropic specularity (even on mobile).
    • Cubemap reflections, adjustable deep and shallow-water tints, correct shore transparency, edge foam.
    • A few variations of water shaders to account for different hardware. Single drawcall. Amazing performance even on older devices and mobile. Fantastic water on desktop.
    • Very easy to set up with your own levels (ready to go in under 5 minutes).
    • Optimized flow animation on mobile devices.

    The system currently has a few minor limitations: water surface is only affected by a single directional light (e.g. the sun, this is enough in 95% of cases. Can create only horizontal water surfaces (i.e. waterfalls are not supported). Lightmap updater supports only single lightmaps and requires a little extra effort to work correctly on a Mac. Water+ wasn't designed for huge water surfaces, having a huge water surface will make the edgeblend look worse (since it's pre-baked into a texture). The shader will have trouble running on iPad 1 (because of a large amount of screen pixels), on iPhone 4 you have to set the resolution to 320x480.

    Performance
    The performance of the desktop version of Water+ (with all of the features enabled) is roughly 2 times better than the performance of Unity's Pro Water. If you decide to use flowmaps, then the performance will be around the same as Unity Pro Water's.
    The mobile version runs smoothly at 35+ FPS on iPhone 3GS.

    The demo looks and feels even better: DEMO

    Available on the asset store.
     
    Last edited: May 4, 2013
  2. blaize

    blaize

    Joined:
    Jul 25, 2012
    Posts:
    41
  3. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I actually have animated edgefoam implemented, but its amount in the scene above was intentionally decreased, because of rather still weather conditions. I'll make another test scene with more foam.
     
  4. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    i'm using unity water on mobile and it works quite well, off course it can be faster thats why i will try out water + .
    the only reason thats keeping me from using cube map based water reflections is that i have an skybox thats has two textures one for day and one for night. they blend over time. if there would be some way to create two cubemaps for these and blend them over time i could have matching reflections.

    could you see if you can implement this?
     
  5. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    This shouldn't be too hard, however it will affect performance on iOS as it requires an extra texCube lookup. Let me know if you want this and I will add this feature into the final release.
     
  6. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    yes if you can add it please do, I'm targetting ipad 2 and up, and two cubemaps should still be faster than the reflections of the unity water?

    By the way this is the shader that I use for the skybox day and night fade.
    Maybe this will give you some idea on what i'm looking for with the cube map blends.
    I hope it's not too slow, seems to work well for me.

    Code (csharp):
    1. Shader "RenderFX/Skybox Blended" {
    2. Properties {
    3.     _Tint ("Tint Color", Color) = (.5, .5, .5, .5)
    4.     _Blend ("Blend", Range(0.0,1.0)) = 0.5
    5.     _FrontTex ("Front (+Z)", 2D) = "white" {}
    6.     _BackTex ("Back (-Z)", 2D) = "white" {}
    7.     _LeftTex ("Left (+X)", 2D) = "white" {}
    8.     _RightTex ("Right (-X)", 2D) = "white" {}
    9.     _UpTex ("Up (+Y)", 2D) = "white" {}
    10.     _DownTex ("Down (-Y)", 2D) = "white" {}
    11.     _FrontTex2("2 Front (+Z)", 2D) = "white" {}
    12.     _BackTex2("2 Back (-Z)", 2D) = "white" {}
    13.     _LeftTex2("2 Left (+X)", 2D) = "white" {}
    14.     _RightTex2("2 Right (-X)", 2D) = "white" {}
    15.     _UpTex2("2 Up (+Y)", 2D) = "white" {}
    16.     _DownTex2("2 Down (-Y)", 2D) = "white" {}
    17. }
    18.  
    19. SubShader {
    20.     Tags { "Queue" = "Background" }
    21.     Cull Off
    22.     Fog { Mode Off }
    23.     Lighting Off        
    24.     Color [_Tint]
    25.     Pass {
    26.         SetTexture [_FrontTex] { combine texture }
    27.         SetTexture [_FrontTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    28.         SetTexture [_FrontTex2] { combine previous +- primary, previous * primary }
    29.     }
    30.     Pass {
    31.         SetTexture [_BackTex] { combine texture }
    32.         SetTexture [_BackTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    33.         SetTexture [_BackTex2] { combine previous +- primary, previous * primary }
    34.     }
    35.     Pass {
    36.         SetTexture [_LeftTex] { combine texture }
    37.         SetTexture [_LeftTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    38.         SetTexture [_LeftTex2] { combine previous +- primary, previous * primary }
    39.     }
    40.     Pass {
    41.         SetTexture [_RightTex] { combine texture }
    42.         SetTexture [_RightTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    43.         SetTexture [_RightTex2] { combine previous +- primary, previous * primary }
    44.     }
    45.     Pass {
    46.         SetTexture [_UpTex] { combine texture }
    47.         SetTexture [_UpTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    48.         SetTexture [_UpTex2] { combine previous +- primary, previous * primary }
    49.     }
    50.     Pass {
    51.         SetTexture [_DownTex] { combine texture }
    52.         SetTexture [_DownTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
    53.         SetTexture [_DownTex2] { combine previous +- primary, previous * primary }
    54.     }
    55. }
    56.  
    57. Fallback "RenderFX/Skybox", 1
    58. }
    59.  
     
    Last edited: Feb 9, 2013
  7. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274

    Update:
    • Added edge-foam and improved edge-blending.
    • Added a slider for water attenuation to make the water more transparent or opaque (see screenshots).


    If I see more people being interested in the system, I'll be adding more amazing features into the final release. So let me know if you like it so far. :)
     
  8. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Looking good!
     
  9. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    Love it ! The foam and the anisotropic reflections look really very well done !
    Count me in for testing this asset if you need any help.
     
  10. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Looks great. Love the baked refraction. :) I would definitely be interested in this if the price was fair. :)
     
    Last edited: Feb 13, 2013
  11. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  12. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Thanks a lot, I'll let you know if I'll need anything.

    I want to make the system accessible to everyone, so the price will be somewhere around $45.

    I haven't tested the system with Flash yet, but there's no reason for it not to work on Flash. I'll post test results later on. Follow the thread.

    Thank you guys for the positive feedback, it keeps me motivated to work even harder. :)
     
  13. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Major update: added a feature that will make the shore actually look wet by updating the lightmap (which means zero performance cost). The resulting lightmap is saved in an HDR .EXR format that preserves all of the lighting data (as in the original Unity’s lightmap). It turned out that Unity cannot save changes made to .EXR images, so I had to find a work-around for that.

    Take a look at the screenshots above to see this new awesome feature in action!
     
    Last edited: Mar 2, 2013
  14. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Bookmarked!

    When will be released on asset-store?
     
  15. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Hopefully I will submit it to the asset store within a few days.
     
  16. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Uploaded a demo, comments are welcome!
     
  17. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Update:
    • Improved edge blending algorithm.
    • Added refractions to undefined areas (where there's no terrain, you'll still see sand underwater).
    You can see all of those improvements in the demo.

    Question: would you guys want the lightmap tool that makes the terrain look wet to support built-in Unity terrain? Currently it only supports meshes (like in Terrain4Mobile), but I can make it work with Unity terrain too.
     
  18. SimtropBuggi

    SimtropBuggi

    Joined:
    Feb 15, 2013
    Posts:
    98
    Very much yes to your question.

    A question for you, in my City Builder game the sun will 'rise' and 'set', does this mean I can't have shore coloring as there would be no baked lightmap?
     
  19. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I think I might have a work-around for you. Lightmap is required for the "wet shore" to work. But what you can do is bake the lightmap only for your terrain while having cast and receive shadows off in your terrain's mesh renderer component. You will also want to have only one directional light on to light up your terrain.
    This way you'll be able to have a lightmap with a wet shore and your terrain will also be affected by any other lights you have.
     
  20. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    For me this doesn't cut it. Where are the waves? The water is very shiny, kind of plasticy, and very flat. There is no simulation of waves at all other than slight surface ripples. I mean... if you want this in a basic low-poly mobile game or something, looks great.. does look better than the Unity one, but I guess it depends on your expectations. Sorry to sound negative - right tool for the right job n'all but I'm not feeling the water at all.
     
  21. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I really appreciate your comment. It makes me work even harder!
    Actually that's what I'm working on right now. I have huge success in making the refractions look more realistic. I'm also doing something with the normals to make the water look more volumetric and colors, it will make it into the next update (in a few days). I'll let you know once I have it done, and hopefully you will like it.

    For now I'm not planning to have actual mesh waves (i.e. with Gerstner equations), but given enough people being interested in the system, I'll implement it in the future.
     
    Last edited: Mar 13, 2013
  22. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    In the demo you seem to have forgotten to add the water texture... :confused: (As in it comes out as a large pink plane) :( Pics look good though!
     
  23. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    The water requires your video card to support Shader Model 3.0 (which is supported on most modern video cards). However the mobile version supports Shader Model 2.0 and will run on almost anything. I haven't uploaded it yet though. I will keep you updated!
     
  24. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    One more thing - Water+ supports flowmaps, which is why the surface looks flat right now (and I'm unaware of any other water system here that also support flowmaps). And as I said, I'll add Gerstner waves in a future release, for those who can afford the extra polys.
     
  25. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    When will be released?
     
  26. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I just need to do some final polishing. Will definitely upload it to the asset store this week.
     
  27. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Major update:
    • Drastically improved anisotropic specularity (per-pixel).
    • Improved edgeblend.


    Take a look at the updated DEMO, it's awesome!
     
  28. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    The water is pink in the new demo, AMD Radeon HD 6750M 1024 MB
     
  29. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I'm aware of the issue, for some reason the shader doesn't run on the webplayer (runs perfectly in the editor though). I'll work on fixing it now, will keep you updated!
     
  30. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Same problem.
     
  31. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Demo fixed, sorry for the inconvenience. Let me know if anyone still experiences problems.
     
  32. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    The web demo is working fine now, the one thing I would change is the water direction next to the coast, it only goes in one direction and I would like to see it go back and forth like the waves in an ocean.
     
  33. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Actually the current version uses flowmaps - you can specify the direction in which the water should flow at any point. This option is pretty resource-intensive and isn't available on mobile though. I'm planning to add support for actual waves in a future release.
     
  34. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Works for me now. Awesome.
     
  35. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Unity terrains are now officially supported by Water+, even the wet shore lightmap tool!
    I still have a few little things to do before the final release though.
     
  36. MV

    MV

    Joined:
    Mar 15, 2013
    Posts:
    1
    these some small flaws are not a big deal, but otherwise a fantastic thing, best in it's class. keep going!
     
  37. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Having some issues with the lightmap tool on mac. Hopefully will fix them today. Otherwise the windows version is completely ready by now.
     
  38. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    664
    Would your water work for a waterfall?

    Can you do a stream demo with rocks, etc - or rather, take the Unity soldier demo and replace that water with your own and make a video or web demo so we can compare it with the pro water?
     
    Last edited: Mar 25, 2013
  39. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Sorry for not answering, I was away for the last few days.

    I haven't tested it with other than horizontal surfaces. I guess it should work, but Water+ was designed for horizontal surfaces in the first place, so I cannot guarantee that it will work with a waterfall.

    I decided for Water+ to support only a single tiled refraction texture - be it sand, stones, or something else. Baked refractions actually refracted objects underneath the water surface, but the resolution of baked refraction map wasn't enough for the refractions to look realistic.

    I'm planning in the future to make a version of Water+ for Unity Pro users that will have real-time refractions and reflections.
     
    Last edited: Mar 31, 2013
  40. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I'm finally done working on the mobile version. Check out the screenshots in the first post, they're awesome!
     
  41. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Can you post more information on configuration options? The water is a nice, blue island paradise color but what about darker waters, such as in lakes?
     
  42. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Hi, you can make the water to be any color - it has adjustable shallow and deep water tints. So anything is possible - oceans, lakes and even rivers! Actually completely transparent or opaque waters are also possible.
     
  43. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Submitted the package to Asset Store. If everything goes well, you should see it released very soon!
     
  44. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    79
    How much will it cost?
    Looks really good ;)
     
  45. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    Water+ has been released on the asset store! The price is $45.
    You may take a look here.
     
  46. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    79
    Could you may provide an android apk, so we cann see how it actually looks on mobiles? =)

    Edit: One more question, is it possible to change the size of the "waves"? =)
     
    Last edited: Apr 16, 2013
  47. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    731
    Hi ilya_ca,
    i see a strange artefact! (web Demo)
    $Immagine1.jpg

    Windows XP
    Geforce 7900 GS (yes... is not a young card ...but works with all water systems)


    Max
     
    Last edited: Apr 17, 2013
  48. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    I'll take look into making an Android apk. Right now you can take a look at the mobile screenshots above (taken on iPhone 3GS, 35+ FPS).

    As for the size of the waves - you can change the scale and normal strength. What you're looking for is probably normal strength, increasing it will make the water look more "stormy". However the water looks best with the normal strength kept low.
     
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    Very cool water, I hope you will expand a little in the future, I really like the way the water looks in metal gear peace walker, wich runs on really old psp hardware, I think this waves could be possible on mobile phone from today.



    I hope there will be animates shore waves in the future, thanks!
    you can see them at 1:20 in the video
     
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    Why do I have to change platforms to bake a light map? this takes hours with my levels....