Water+ (for Unity Free and Mobile)

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.

Looking great, but the water is clearly missing foam around the island.
perhaps sharing this link with your buyers will alow people to put the finishing touches to your great looking water:
http://forum.unity3d.com/threads/29578-auto-foam-generator-request

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.

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?

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.

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.

Shader "RenderFX/Skybox Blended" {
Properties {
    _Tint ("Tint Color", Color) = (.5, .5, .5, .5)
    _Blend ("Blend", Range(0.0,1.0)) = 0.5
    _FrontTex ("Front (+Z)", 2D) = "white" {}
    _BackTex ("Back (-Z)", 2D) = "white" {}
    _LeftTex ("Left (+X)", 2D) = "white" {}
    _RightTex ("Right (-X)", 2D) = "white" {}
    _UpTex ("Up (+Y)", 2D) = "white" {}
    _DownTex ("Down (-Y)", 2D) = "white" {}
    _FrontTex2("2 Front (+Z)", 2D) = "white" {}
    _BackTex2("2 Back (-Z)", 2D) = "white" {}
    _LeftTex2("2 Left (+X)", 2D) = "white" {}
    _RightTex2("2 Right (-X)", 2D) = "white" {}
    _UpTex2("2 Up (+Y)", 2D) = "white" {}
    _DownTex2("2 Down (-Y)", 2D) = "white" {}
}

SubShader {
    Tags { "Queue" = "Background" }
    Cull Off
    Fog { Mode Off }
    Lighting Off        
    Color [_Tint]
    Pass {
        SetTexture [_FrontTex] { combine texture }
        SetTexture [_FrontTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_FrontTex2] { combine previous +- primary, previous * primary }
    }
    Pass {
        SetTexture [_BackTex] { combine texture }
        SetTexture [_BackTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_BackTex2] { combine previous +- primary, previous * primary }
    }
    Pass {
        SetTexture [_LeftTex] { combine texture }
        SetTexture [_LeftTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_LeftTex2] { combine previous +- primary, previous * primary }
    }
    Pass {
        SetTexture [_RightTex] { combine texture }
        SetTexture [_RightTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_RightTex2] { combine previous +- primary, previous * primary }
    }
    Pass {
        SetTexture [_UpTex] { combine texture }
        SetTexture [_UpTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_UpTex2] { combine previous +- primary, previous * primary }
    }
    Pass {
        SetTexture [_DownTex] { combine texture }
        SetTexture [_DownTex2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
        SetTexture [_DownTex2] { combine previous +- primary, previous * primary }
    }
}

Fallback "RenderFX/Skybox", 1
}

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. :slight_smile:

Looking good!

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.

Looks great. Love the baked refraction. :slight_smile: I would definitely be interested in this if the price was fair. :slight_smile:

flash?

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. :slight_smile:

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!

Bookmarked!

When will be released on asset-store?

Hopefully I will submit it to the asset store within a few days.

Uploaded a demo, comments are welcome!

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.

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?

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.

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.