shore wave challenge

Started by Dune, September 27, 2020, 02:20:32 AM

Previous topic - Next topic

Dune

Here's nice challenge for you; getting (coastal) water to react on the altitude/distance between water and planet, altering the basic sine curves (though some graphs represent them as simple sine waves, others with elongated, and flatter lower end curves). The variables are there (water level, coastal altitude, angle/slope), it's just a matter of putting it in an equation ;D

Hannes

Quote from: Dune on September 27, 2020, 02:20:32 AMit's just a matter of putting it in an equation
...should be a piece of cake! ;) ;D ;D ;D ;D




Oh boy... quite a challenge!

cyphyr

Lots of variables here, distance to/from shore, altitude above sea floor, distance between peaks (and lots more I expect) and they look like they all effect each other.
Pretty involved I would expect.

Personally I don't think this is necessary (not that the challenge is invalid in any way, lots to be learnt here!)
What I mean is that much of this can be achieved in most cases by simpler means. Simple shapes, shader arrays and redirect (and/or fractal warp) can go a long way.

I think the hardest part here is the texturing, the way the foam trails behind the wave crest for example.

By the way a quick hack to get the sine waves to be further apart could be to use a soft maximum.

Interested to see what comes up :)
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Dune

Soft max, good idea.

I know it can be made simpler for local areas, but it would be cool to have a 'click and go' shader for coastal waves/surf, even if it isn't perfect in close-up.

sboerner

Maybe find the vertical distance between the surface of the water object (lake or sphere) and the underlying terrain, and calculate wave height and shear (and foam) based on that? (Probably could use a constant for the height of the water surface.)

DandelO's solution here might be a place to start.

WAS

#5
I'm sure some of the features I added to my sand shader could be used that effect sinus waves. Flatter tops, peaked tops, deeper troughs, flatter troughs, etc.

I always have issues with shore waves though, I'll be honest. Hate them in TG xD

Dune

I have done previous work on this and learned a lot from some guys here over a decade or so, so I got pretty far. At least as far as to get surf near beach, with wider waves offshore, but some things are still hard to accomplish, hence my quest for ideas. New guys around, so you never know ;)

The most problematic thing is to get the normal off the coastline/beach and translate that into a (stronger) shear (or what you'd call it) towards the beach, like surf. Twist and shear, redirect, vector displacement, all work in a static direction, afaik.

Another thing is to mix two sine waves to get some variety from the basic straight lines (besides warping them a bit). Tried to mix sine and cosine, but they seem not to work together. Shifting them a bit by PF is awkward too, as the mix won't work very well yet. The soft max is therefore a good idea; it works nicely, and is an interesting addition.

N-drju

Quote from: cyphyr on September 27, 2020, 05:31:33 AMPersonally I don't think this is necessary (not that the challenge is invalid in any way, lots to be learnt here!)
What I mean is that much of this can be achieved in most cases by simpler means. Simple shapes, shader arrays and redirect (and/or fractal warp) can go a long way.

Shader array can be quite effective indeed albeit painfully slow. It gets even slower, the more repeated instances you have.

Fractal warping of a stretched power fractal indeed creates a brilliant wavy pattern. This option, however, is challenging because you still need to align the waves with the shoreline.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Hetzen

I had a crack at this about 4 years ago. There's loads of parameters and it all needs to animate together to get anything anywhere near convincing. I think it's possible, but there's loads of abstraction to get your head around with the vector displacement.

vWaves_20 show's that a curl is possible. 

vWaves_20.jpg

vWaves_21 shows the tip of the wave falling along the x axis, which this scene was looking at just that aspect, the tip should curl in more on the right hand side and the wave peak lower. Then there's the splash back to work out, then there's how the shore foam works. All this whilst dealing with vector stretched surfaces and making sure texture space doesn't run off and scale into oblivion. :)
vWaves_21.jpg

N-drju

Quote from: Hetzen on September 28, 2020, 08:32:10 AMI had a crack at this about 4 years ago. There's loads of parameters and it all needs to animate together to get anything anywhere near convincing. I think it's possible, but there's loads of abstraction to get your head around with the vector displacement.

They look fantastic Hetzen. Nice skills!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Hannes

Wow, that looks amazing, Jon!

Dune

I knew it! ;)  You showed me that years ago, but not as far as this. Great! But does it follow the coastline?
I've done some trials lately, and came up with this. By getting the normal off the waves and displacing by a range from coast to deeper water, I got some sort of surf that does indeed follow coastline.

WAS

If your terrain is soft enough you can warp very heavy on Y and you get ribbons along the shape of terrain, they can be smoothed too. Haven't messed around with it but kinda easy way to warp a PF around the shore.


I imagine somehow that pinch and bulge function could be used to create larger gaps in waves further out on a basic sine too.

My sand shader as well as peak and trough modifications has meandering too. :) Issue with mixing meandering is intensity of the scalars shifted and mixers softness used 

PS that node network looks intense Ulco. Lol

Hetzen

Quote from: Dune on September 28, 2020, 12:16:02 PMI knew it! ;)  You showed me that years ago, but not as far as this. Great! But does it follow the coastline?
I've done some trials lately, and came up with this. By getting the normal off the waves and displacing by a range from coast to deeper water, I got some sort of surf that does indeed follow coastline.

Those images look good. I like the rock work as well.

What I was working on will do, I was using the z axis as I would the Altitude below and slightly above sea level. As you know it's quite tough to get a nice looking below water surface gradient to work with, so while testing i set up this rig scene. The approach would have involved making a plan render of the landscape normals and another of the elevation, then setting a wave direction that interacted with the planar direction of the coast, and changing the break position depending on y normal, the altitude driving the wave cycle adding a frame offset to drive it animating. But haven't got that far.

Hannes

Guys, you are geniuses. I don't understand what you're talking about, but I like it... ;)