[WIP] Flowmap Rivers for AQUAS

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.

15 Likes

Wow pretty amazing! With a bit of work this could look pretty realistic without hard edges :slight_smile: Keep on working! This is a thing many users would need! :slight_smile:

1 Like

@etaxi341 Thank you! :slight_smile:
The hard edges are a matter of the flow map. The shader handles them as they come in. The hard edges become visible as one increases the flow speed, so it’s a balancing act getting the flow to look natural and still keep the edges as invisible as possible. I’ve messed around with gaussian blur on the flow map to reduce the visibility of those edges and it works pretty good, yet it’s not able to remove them completely.
I’ve also tested different angles and realised, the adges are pretty far away from each other if the flow map is a bit blurry. Then the edges are so far apart, that they wouldn’t be visible in an FPS or 3rd person game, but would only be seen from far away.
I’m still testing around, so we’ll see. :slight_smile:

2 Likes

Amazing, Chris! Can’t wait to use this. :slight_smile: The asset store has needed this for a very long time.

1 Like

Hehe, thank you. :slight_smile:
I’ve come to test a parallax occlusion mapping, but so far it doesn’t look good on water. It works alright, it just doesn’t seem to make it look any better, at least not considering how much more performance parallax mapping costs. However, I’m currently trying to use a custom reflection probe, which seems to be rather promising, especially in combination with the flow map support.
I’ll post updates as soon as I have them.

P.S.: A user just hit me up and gave me the idea of adding emission to the shader. This way - with the flow maps - it could also be easily used for things such as lava - we’ll see. :slight_smile:

Uhm… Is it done yet? :stuck_out_tongue:

Seriously though, great work! Looking forward to seeing what you come up with here. Rivers and streams sound great… Adding the emission option to it for lava flows = AWESOME!

1 Like

I plan to have it ready by the end of may, but no guarantee as of yet - you know how it works: all those little issue that continuously pop up along the way… impossible to count them all in. :smile:

2 Likes

Updated the initial post and prototyped a quick lava river scene to test the emissive shader.

5 Likes

Just added the distance based tiling. It bloats up the shader quite a bit, so I’m wondering if I should really get this in, in short: I’m not sure, if it’s actually worth it. Here’s a quick demo video. It shows the camera starting at about 3 m from the water surface moving away and then closing back in. The farthest point to see is about 3 km away.

8 Likes

Reworked the normal textures for 1.3. This is how it looks now:

5 Likes

Will there be any price raise with the new update? Planning to buy this eventually cause it seems awesome.

Can we turn off special stuff to increase performance? :slight_smile:

1 Like

Isn’t there several shaders? Can’t you just use a less heavy one? Would be nice with finer control though I guess : )

1 Like

From v1.3 on it will probably be $10 more for new customers, but I’ll announce that again several days before it goes life, so no need to panic. :slight_smile:

@Teila special stuff being? As @virror says, there’s a number of shaders for different performance levels and in the current version even the heaviest one is extremely light weight. The river shader will be a bit heavier, because it requires an additional pass, but it’s only meant for creating rivers with it, other than that it’s the same as the triple textured water. Yet still I have the river shader easily running at 300 FPS on my old machine.

1 Like

I already own it so it doesn’t matter. lol But I always ask that as I see the assets I buy become more and more complex. Looking forward to the river shader. :slight_smile:

Btw, i guess the rivershader will also have different shaders for different machines?

@virror nope, the river shader can only be used based on the triple textured shader. On the other ones it looks very unnatural, so I think there’s only gonna be one river shader.

Ok, great to know!

Added a buoyancy feature:

More info in the first post.

4 Likes