Coastal waves/foam thru functions?

Started by Dune, April 17, 2009, 03:13:55 AM

Previous topic - Next topic

moodflow

Many thanks to Dune, Kranky, Hetzen, and Old Blaggard! 

I took a sample of the terrain's altitude before the water plane, and was able to create a mask to blend the swell off into the deeper water.

Next, adding whitecaps!
http://www.moodflow.com
mood-inspiring images and music

neuspadrin

wow this is getting impressive.

what would be reallllly awesome is if we could mimmic ocean waves/surf.

Hetzen

#17
Nice work Moodflow. I'm in the process of blending the white horses out from shore, as well as distorting the sine ripple effect laterally. I think some PF blending here and there, and then I think we, have got this licked.

moodflow

Nice work Hetzen!  I'm trying to do the same, but haven't gotten that far yet.  Exciting stuff!
http://www.moodflow.com
mood-inspiring images and music

moodflow

#19
Well I am still having trouble adding foam properly.  For some reason, I can't seem to pull altitude information from a water shader, even though the waves on its surface show altitude differences in the preview window.  However, slope does work.

UPDATE:

I think it has something to do with the lake object.  I tried some slope and altitude constraints on a surface layer with a test color as the ground surface, and it worked.  But plugging the same nodes into a lake object does not work, so this is going to make it hard to color the water surface with foam appropriately.
http://www.moodflow.com
mood-inspiring images and music

Hetzen

I added a compute terrain after the water shader. Then for some reason got mine to work with a minimum altitude of 1, fuzzy 1. Not sure if I need the compute terrain in there, but at the moment have got my head stuck in how to shift the concentric'ness of the sine wave with a power fractal, which I'm having no luck with. Distorted it fine, but not shifted.

moodflow

In real life, waves (as swells) travel as very shallow sine undulations. As they approach shallow water, they compress and steepen, as well as refract to match the bathymetry.  So we are to this point so far, just without the compression.  See the attached file below, though its still not accurate in the fact that the waves in this file actually "die off" in deep water.  I am going to work on this next.

As swells get to even shallower water, they steepen further, with the leading edge of the wave front becoming steeper than the trailing edge forming a cusp like appearance, similar to sand dunes.  I'm not sure how we can pull this off yet in TG2, but its very likely possible with extensive tests.

Of course, when the wave front's steepness becomes too great, it will break.  Depending upon how fast this happens (which depends on the bathymetry's slope angle), it will roll, plunge with a tube, or spill.  We can likely simulate the rolling and spilling, but the plunging will likely require serious work beyond what any of us have accomplished yet, and even require a 3D model to pull off.

Anyway, when waves break, the chaos generates whitewater.   Waves break due to many factors, including wind chop "white caps", breaking waves over a shoal, or splashes due to blunt object impacts (like boats, pier posts, asteroids, etc).  When the whitewater subsides, it leaves "soup", which is a stringy/matty looking weave of bubbles. 

I've been trying to simulate "soup" near the coast, but unable to get it to fade off into deep water at this time.  I have been able to get it to appear all over the entire water surface, but this is unrealistic unless the water is mega choppy.
http://www.moodflow.com
mood-inspiring images and music

Dune

Well, this all looks very interesting. I have been busy for 2 whole days now (while the weather is too good to sit inside), and somehow got a nice surf from Kranky's tgd with smooth 'valleys' and rougher crests, with foam getting denser near the coast and even with a bias towards the peaks... but I lost it. It had to do with a floor and a ceiling and a combine scalar. I will try to reconstruct. I have also added a powerfractal somewhere to break the sinuses into slightly more random displacement.

Even without the waves it should be possible to get a height from the terrain and distribute just the foam according to a higher height (= shallower water), I've been plodding on with that as well, but cannot give any results so far. I will study all your replies and hope it starts raining, so I have a better excuse to get behind the pc.

---Dune

Ah, a reply by Moodflow while I was posting. As I said, I was able to have it fade, but I didn't safe that stage  :-\ and it got lost in subsequent trials.

Dune

I quickly got to work with moodflow's tgd and came up with this. I don't really understand it, and it's not very tweakable, but it might help. Getting the proper depth to work as a mask for the foam should be possible somehow...

---Dune

Hetzen

#24
Thanks Dune, I'll take a look at that in a moment.

Something I've found, is this method (or the way I've taken it) seems to mess with altitudes and masks post water shader. So Moodflows altitude shader doesn't work for me. I started off using functions to determine the amplitude of the ripple.

Hers's my version of the TGD for people to play with. I'll post the cropped render I'm doing at the moment when it's done.

*Edit* Just looking at the render, looks like I need to roll back a little, I've lost something in the foam.

Hetzen

@ Moodflow

Fully agree, to get breakers working would be a whole new avenue to follow, and I don't think I have the ability to work that out with a node network. Tbh, I don't think I'd want to use Terragen to create wave effects in an animation full stop. For a multitude of reasons, back draw of the waves would be in my mind the biggest hurdle.

What has been good for me, is to be able to expand on others thought processes in achieving a set goal. It's interesting to see others aproaches to solving a problem. Thanks guys.

Hetzen

Right this render was interesting. It seemed to get stuck here after an hour, so pulled the plug. This is from the above TGD. I'd like to call it "Nun in a bath sunami".

What I was trying to achieve with the whiter surface layer, is some sort of sand/foam refraction caused by the wave churning up the shore line. Sort of works. But the newer foam settings have made the breakers look more bubble like, which was not the intention.

Here's the roll back for someone to play with. Let us know how you get on.

Cheers

Jon

Dune

I went to play with Hetzen's latest file, and changed some things, such as adding twist and shear on the waves, adding extra foam at sea as well as on the beach, etc. I also replaced some constants by fractals to get a more natural dispersement (is that the right word?) of waves. Also made some shiny sand with a reflective shader. Came up with the following image after a couple of hours of trials. The only thing I had to do was tilt it 0.5 degrees in PS (probably the whole water angled due to the twist and shear).
I will decrease the scale and displacement of the beach foam, it's a little too ridgy. And add some child layers here and there to get more diverse colouration.

This is certainly getting somewhere. But I'm still looking for a way to decrease foam at greater depths.

---Dune

mhaze


Tangled-Universe

Quote from: Dune on April 19, 2009, 09:42:53 AM
I went to play with Hetzen's latest file, and changed some things, such as adding twist and shear on the waves, adding extra foam at sea as well as on the beach, etc. I also replaced some constants by fractals to get a more natural dispersement (is that the right word?) of waves. Also made some shiny sand with a reflective shader. Came up with the following image after a couple of hours of trials. The only thing I had to do was tilt it 0.5 degrees in PS (probably the whole water angled due to the twist and shear).
I will decrease the scale and displacement of the beach foam, it's a little too ridgy. And add some child layers here and there to get more diverse colouration.

This is certainly getting somewhere. But I'm still looking for a way to decrease foam at greater depths.

---Dune

That looks bloody good already :)
Think you have nailed it down quite much already.

Can I take a look at your setup, what you have changed to it? I think I may have an idea to improve the fractals for the foam as well as to give it some volume :)

Martin