[WIP] AQUAS Water (multi purpose)

Since I couldn’t find a water shader, that suited my needs, I decided to make my own one. The problem with mobile shaders is to find a balance between good looks and high performance.

Here’s the latest update:

EDIT:
I’ve decided to expand the project, so now there’s multiple quality levels from low to high for different types of applications and devices, so I’m not trying to limit things to mobiles. I’m trying to make everything as flexible as possible. All of them now have optional shore foam, depth based transparency and realtime dynamic reflections. I’ll go from the lowest to the highest:


The low quality shader has only one color, and a slight depth based transparency.


Two different colors (for deep and shallow water) with slight depth based transparency for the simulation of realistic water absorption. Everything works pretty okay on mobiles up to this point.


The difference between this one and the previous one is, that this shader does the actual color absorption. It also has real refraction, to make the transparent part of the water distort the visible ground. Color absoprtion and refraction though, will bring most mobile devices down to their knees, except for the most powerful ones, but it shouldn’t be a problem for future generations.


Added a second normal map for the wave textures. The two wave textures now blend over each other, to make the specularity look more natural and less repetitive.

At some point I decided to deform the mesh, so see if the shader plays along and YUCK - it looked awful! That was mainly, because up to this point the shaders didn’t really have a solid surface. All the surface shows is the specularity and the distorted reflections. That’s quite enough for quiet waters like lakes or basins, especially in RTS-like games.

So I decided to create a second shader with more bumpy surface:

It has 3 textures for waves, that blend smoothly into each other, depth based transparency, shore fade, refraction, distance fade on the shore foam, to prevent the tiling from becoming ugly at long distances and of course the realtime reflection.

This of course goes way beyond mobile capacities, especially because it’s a PBL shader. But I’ve decided to see, if I can strip it of some things, that are not vital and see, if I can get this one in an acceptable quality for mobiles.

So I decided to use this shader as a basis for an ocean. The next step was, to see how the shader plays along with waves. For testing I simply animated a mesh based on a sine wave with noise.

Of course a simple sine wave doesn’t come close to Gerstner waves, so it’s very far away from being realistic. But the shader seems to deal with the deformation pretty acceptably.

The next step will be to find a way to simulate more realistic waves. I’m not yet sure, which approach I’m gonna use, because there’s multiple ways to do that, from very simple to overly complicated (guess it’s gonna be something in between). After that, the shader will need to be adjusted to behave depending on vertex positions to get foam and partial transparency on the more choppy parts of the water. But it’s still quite a way to go.

I wonder if I should already post the surface shaders on the asset store, even before I get the waves to work, there’s a lot of people who don’t need waves after all. But on the other hand, the asset would feel kind of incomplete. :smile: What do you think?

1 Like

wow, nice! Will you be putting it on the store soon?

Well originally I only wanted to make it for my own game. But I think, I’m gonna put it in the asset store, when it’s ready. I’m currently working on 3 different quality levels for less powerful as well as very powerful and future generation devices. The above shader is medium quality and it runs at about 30 FPS on my Nexus7 (with a Unity terrain in the scene)

I’ve also added optional shore foam to all quality levels. It took quite a while, to get some good looking foam, without bringing the device to its knees. The low quality water also has an optional emissive color, so it can be used for things like lava or poisenous broth in darker scenes.

I’ll be posting some updated images and a demo video next week.

I’m thinking about sharing an APK in this thread, to get some feedback on performance on different devices - that is, if people are interested…

So it’s been a week now, and I’ve been pretty busy since then. I’ve updated the first post to give an overview over what I’ve been busy with.

I also had some fun using the lowest quality shader as lava in a very dark scene, by adding an emissive color to it, but it doesn’t look as nice, as I hoped, it would. :smile:

I tried this on the Wii U last night and it works quite well. The performance is good and it looks very nice. I even tried the underwater effect and it operates as expected even with the camera lens splashes when exiting the water.

I’m happy to hear that! I’ll finish the v1.2 update this weekend (hopefully). If you send me your invoice number, I’d be happy to send you a copy of it in advance.

Sent in PM.

Hello i contact with Christian Stan But I get no feedback anymore my question is that if I found the problem
i have sent the link with the project and i have not heard anything from you.Please contact me.

Hey sorry, I must have missed your message. I’ve just sent you an email.