Hi everyone,
I’m currently working on the next big Update for AQUAS (v1.3), which will have flowmap support for rivers implemented. Right now I’m tweaking one of the water shaders to support flowmaps and build a test river to see how it’s working. Here’s the first result:
Unfortunately changing the flow speed also affects the consistence of the flow map, showing hard edges at certain points, whereas keeping the flow speed too low, will reduce that effect but also the visible flow. The flow speed can also be controlled by the way the flow map is being painted alright, but painting flow maps isn’t all that easy if you’ve never done it before.
Some more features I want to add and document the process of here are parallax mapping and ambient occlusion mapping for the normal textures. Since AQUAS is all flat shaders, parallax mapping to replace normal maps (or enhance them rather) makes sense. Parallax mapping works similar to normal mapping, with the bump effect being significantly more believable. I plan to make AQUAS look more natural this way. However having shadows is even nicer and here’s where 2 problems come in.
The first problem is that it can be a bit tricky to add believable shadows to normal textures on a perfectly flat plane. The other problem is that AQUAS consists of alpha blended shaders only which - as a limitation from Unity - can’t receive shadows from light sources at all.
Here’s where the parallax mapping comes into play. The intention is to not only use parallax mapping, but instead use the alpha channel of the height map for the parallax effect to create an ambient occlusion map and effectively have a parallax occlusion map.
As of yet, I don’t have anything to show concerning this, but I’ll keep the thread updated.
EDIT:
Added emission to the shader after a user pointed out, that it might be useful to make things like lava rivers. I prototyped a quick scene to test how that works:
Obviously perfect lava looks different, yet still for things such as glowing green flowing stuff it might come in handy. One thing though that is still a bit tricky is the colors. Colors rely heavily on the light that the surface receives. In very dark scenes a slight influence of light is still required.
Another thing I tried was to atlas the textures to keep the texture amount <4. This was because I wanted to avoid having to add another pass to the shader and keep it leight on performance. However I ran into some problems regarding the texture pan and the flow, which will distort and offset the textures far enough to make neighbouring textures from the atlas visible. So for now, I keep it at 5 textures with the additional pass. If I can’t sort this out, I’ll make the river shader an extra shader to leave the possibility open to use the classic triple textured shader if river flow isn’t required. This way users will still be able to keep performance impact at a minimum, wherever they don’t need a river.
EDIT:
Added the distance based tiling to the river shader today. It’s designed to remove visible tiling at long distances. Will do that to the other shaders as well, but I was wondering if it’s actually worth it, because it bloats up the shader quite a bit, so any feedback is appreciated. Here’s a test video. It shows the water from about 3 m distance as the camera moves away. The farthest point to be seen at long distance is about 3 km away:
EDIT:
Reworked the normal textures. This is how it looks now:
EDIT:
Added a buoyancy feature. Turned out it was quite difficult to make it work on any mesh, since buoyancy forces applied on inhomogeneous meshes seem to cause overkill torques. For that I added balance koefficients for the rotation around each axis.
Still for meshes that exceed a certain size, float precision is just not enough anymore and causes numerical inaccuracies. This can be compensated by reducing the water density. Since the water density can be set for every individual object, this shouldn’t be a problem, so with that there’s a buoyancy feature that should work on any mesh.
EDIT:
So AQUAS 1.3 is pretty much ready for release now. I’m currently having fun building some demo scenes:
I have decided to leave the emission feature out of 1.3, because it bloats up the shaders for everyone who doesn’t neet that.