PlayWay Water - high quality water system

I’m proud to present a water system that I’ve been developing for games at PlayWay for the last few months. It took many nights and caffeine drinks to complete it in parallel to the game projects I’ve been working on, but here it is.

I’m doing some final polishing right now, before I’ll submit it to the Asset Store this weekend. I hope that some of you will find it useful during your everyday work.

Waves simulation
Simulation is based on the recent oceanographic research and is very convincing. Fast Fourier Transform is used to simulate tens of thousands of waves in realtime, while Gerstner Waves sampled from the same spectrum are used as a fallback.

Weather changes at runtime are fully supported.

Shader
Based on Unity 5 Standard Shader, but heavily improved for the fluids. New features include improved microfacet model that takes waves smaller than a pixel into its formula. This ensures that water will look good at all angles and distances. It’s sharp from up-close and completely smooth at the planetary perspective.

Another notable feature is ray-march based, volumetric lighting. When viewed from above of water it is seen as a subsurface scattering, but when viewed from the underwater it makes the effect of “dancing lights” and dark depths.

Some more self-explaining and common features include tessellation, planar reflections, refractions and reflection probes support.

Foam and spray simulation
Foam is self explaining. Spray is simulated with particles on GPU and appears when wave gets too big and breaks. Compute shaders are involved.

Hardware requirements
Adapts to the target hardware and works with all shader models. It’s done fully automatically so change your build platform in the Unity settings and you are good to go.

Mobile devices support is currently a beta, but I’ve had it running pretty well on few devices including iPad 2. Possibly you’ve heard about its infamous fillrate. Please let me know of any issues, I’m willing to put my work into fixing compatibility issues on mobile platforms over time.

Physics
Very realistic, multithreaded and has minimal impact on performance. Period.

I’ve simulated 1500 objects using it without noticeable performance hit. Computes drag and buoyancy forces. Computations are done only if necessary.

Profiles support
You may create water profiles in your assets library and interpolate between them at runtime. It improves productivity and separates the artist workflow.

Integrates cleanly into rendering pipeline
Supports forward and deferred rendering mode and writes correctly into the depth buffer in both of them. Supports all image effects I’ve tested including standard assets ones and SCION.

The only artifacts that I’m aware of are transparent objects submerged completely in water. I have some ideas to solve it in the future though.

Volumes
This one is pretty cool and I plan to create a dedicated video to demonstrate some of the possibilities that it puts in your hands. You are not limited to simulate endless seas. You may create a puddle or just a glass of water and define it’s volume with colliders (including convex meshes). Physics will respect that and no fluid forces will be applied outside. Underwater image effects will also be applied only within the volume.

It may also work in the opposite manner. You may create subtracting volumes which will remove water from their insides. It is a must have for ships and boats, but it also works for fully submerged objects like submarines or underwater bases. Best of all - it correctly renders the transition between air and water that may be visible through transparent objects like windows inside ships or all over the glass in underwater bases.

2331705--157475--Volumes.gif

Underwater image effect
Applied correctly in transition between air and water. Makes distant objects blurry and makes them fade away in a physically correct manner. Environment gets darker at the depth. Automatically applies underwater audio effect.

When you get your camera out of the water a “wet lens” image effect will be applied for some time.

Plans for 2015
Some of this is already in progress. Research already done.

  • Caustics,
  • Marine snow,
  • Shoreline waves,
  • Dynamic waves and foam created by physics,
  • Mobile platforms out of beta.

Additional assets
Asset bundle will also contain a few additional PBR assets:

  • Galleon,
  • Boat,
  • Seagull with 3 animations,
  • Pontoon and lifebuoy.

Other stuff
Network water synchronization component is provided. You may define a seed for the water to make it predictable in cutscenes etc.

Water may be rendered using one of built-in primitives: radial, projection or uniform grid. Custom meshes are also supported and useful for small lakes, puddles etc.

Full source code included. All scripts are written in C#.

Links:
Asset Store
Web Player (Weather Demo)
Web Player (Galleon Demo)
YouTube - Galleon Demo
Documentation

22 Likes

Looks fantastic!
Would it also look so good for very smal waves like on a small lake?
I´m doing ArchViz…

Thank you :wink:

Yes, one of our teams has used it for a lake in their game. I will post some more screenshots soon.

It looks very, very, very nice!

Yup, Ill be watching for this one. Any idea on what you will be asking for it?

Thanks. The introductory price will be 109$.

Wow! Just wow!

That is some really AAA water here.
Put in the shore line waves and we are good to go.

edit: a demo with an fps counter would be nice, so we could test the performance.

2 Likes

Where did this thing pop up from!! Nice.

Bump

Sure :wink: I will build a web player with the galleon demo (the one on video) during this weekend. The recording was done with high settings on decent graphics card (GTX 960) at 54-60 FPS. On dx12 it’s a lot faster (70-80 fps), not sure why.

There is a noticeable drop in FPS during the weather transition in demo, but according to the profiler it’s caused by Unity’s Environment.UpdateGI. It shouldn’t be a problem with Time of Day and other weather systems.

Thank you all for the kind words.

It looks pretty cool

The very best in my eyes would be a switch to disable/enable only the water and then compare the framerate.
This way we could exactly determine how fast it renders!

I plan to add quality settings gui to this demo. Such option sounds like a good fit to it, sure.

It’s actually lighting fast, it has started as a mobile project. Settings on the video are a bit of overkill. Here is how it looks on low settings running at 420 fps:

2331873--157501--upload_2015-10-9_11-26-39.jpg

1 Like

Wowzuh. Hmmm. Ill need a demo for that one then HAHA. No offense, the shots are great, but I certainly would want to be able to see it in action in a web player demo or something. =)

Yeah, even them low settings look pretty darn good. Will it support ES2? If so how does it look on ES2 devices? Water can be a bit tough with ES2 to make look great.

When do you release it?

Yeah… should run on most of them, but it will look like Unity’s water4.

Next week.

Ahh yeah, well at least you are making it simple to set up. If you post the manual that would be even better than a demo. I like to see “how” something is set up and what all that entails to use it before I make a purchase. I can also tell from that if it will conflict with any of my other things.

Looks really great. I might have to pick this one up.

Oh this looks neat. If you get dynamic, physics based waves - just from a player walking through the water, for ex - I would definitely pick it up at almost any price.