foam on water crests

Started by james adamson, December 12, 2020, 10:56:38 AM

Previous topic - Next topic

james adamson

Hi all.
I am trying to get a sense of turbulence and foam on the crests of some choppy water. I am making some good progress with using a merge shader
and cutting away the lowest but am finding it tricky to get the control I want. The shader is affecting unwanted areas, I really want the effect just on the ridges
or crests. Also I am using a displacement to scalar as an output from the water shader to get my displacement greyscale values, is this correct?

Dune

There are several ways. You could simply add a surface shader after the water, give it a foam color, and set altitude and fuzzy zone very finely, so only tops will get white. Break or mask it by some foam fractal (like warped voronoi ridges), or more elaborate foam of course.
You could also use the displacement to scalar, add a color adjust and use that to determine what area needs to be white. Use as mask for the surface layer, or through the foam voronoi. But the principle is in fact the same.
The problem with foam is that it may start on the roughest crests, but will linger or float off after that, so to have a very natural flow of foam, you'd need more than just the altitudes. Complicated to get that done, if at all possible. You'd need some sort of delay by frame, and translation built in.

Hannes

Here is something to play with:
https://planetside.co.uk/forums/index.php/topic,28655.new.html#new

It's a mix of animated transform shaders and intersect underlying stuff. The file is more or less the result of this thread:
https://planetside.co.uk/forums/index.php/topic,24752.0.html

james adamson

Thanks guys.
I did try the techniques you mentioned Dune. I guess it is all about small numbers. I think that is one of the hardest things I find with Terragen.
That being to get that small detail (which is a massive part of selling a shot IMHO.) It is very hard to know what numbers to start with. A wave scale
make sense but getting tiny detail from power fractals I do struggle with on water. Anyway its good to know i have not been barking up the wrong tree.
Thanks.
Also that water Hannes from the thread looks amazing! I was expect a node graph from hell but no. Not a blue node in sight.
Can I just go through what I think is happening stage by stage as this helps me understand whats happening.

So.
1.Two water shaders 1 lrg 1 small merged to get different wave scales.
2.Twist and shear on large waves. I have not come across this node but is it just to create a more organic wave shape?
3.Transform inputs on both water shaders give the general motion?
4. The two pf's spit out a displacement value for 2 additional motion lattices these are then animated by the transform inputs?
5. The redirect converts the pfs'   y displacement and tranform inputs  into a more directional displacement to enhance the sense of motion across the surface?
Essentially creating two more motion elements across the surface?
And the rest is colour.

I hope you do not mind the long winded reply but It is the only way I will be sure whats happening.
Thanks again.
James.

james adamson

Just to clarify. My breakdown was based on the tgc you put up Hannes.

Hannes

;D ;D ;D  Yep, no blue nodes. It's fairly simple. Your explanation was correct. The transform shaders only move the inbuilt displacements of the water shaders. The redirect shader is just for the direction. Horizontally in this case. I hope this helps...

james adamson

It most certainly does!
Thanks.