Spellcaster Studios

Make it happen…

Water flow shader

Still working on the water flow shader…

After I generated the flow map, this was the result:

screen474

A lot of noise in most of it… The rest flowed correctly, which was good, though! Smile

Drawing the displacement, everything seemed to be ok:

screen475

And the base UVs:

screen476

And the displaced UVs:

screen477

So the problem seemed to be the displaced UVs… After some head-scratching, finally arrived to the conclusion that the problem was the linear sampling: pixels in vicinity of each other had slightly different flow values, but when you add time to the equation, the small changes become huge, hence the noise…

Switching the filtering mode, I got a good result: the water now flowed the way it was supposed to, but the results were frankly disappointing, nothing like I envisioned…

Partly the reason is that the source texture (which I’m offsetting) is so varied in term of hues, so the grid based nature shows too much with the shader (because the displacement changes from cell to cell), which looks awful…

My solution for now is to do two layers of texturing: a base texture and a (simpler) flow texture on top:

screen478

The texture is temporary… The results are way better, but the flow now is all wrong… Quite hard to explain, but the fact is that the UVs that get displaced are aligned to the screen and they probably have to be aligned with the flow…

I also think that it might be interesting to add a kind of “shore” to the water: use one channel of the flow map to describe how far the water is to the edge and use that to select a color for the water (so mid of the river is darker than the edge of the river, for example).

So, I still have a lot of stuff to experiment with, which is rather fun (albeit time consuming!).

Now listening to “Follow Me Into Madness” by “Tarot”

Comment