Planetside Software Forums

General => Terragen Discussion => Topic started by: Dune on April 17, 2009, 03:13:55 AM

Title: Coastal waves/foam thru functions?
Post by: Dune on April 17, 2009, 03:13:55 AM
Perhaps this has already been discussed (I've read a few discussions on water displacement near the coast), but I wonder if it would be possible to somehow get the depth (Get Altitude?)and 'transfer' this to the waterplane with a certain displacement. It would in theory be possible to raise the water level at certain depths (waterlevel minus 1, waterlevel minus 2, etc) , and lower at others (with a little overall displacement to roughen the water). Not physically correct maybe, but perhaps good enough to get the idea of coastal wave displacement.
Foam slightly behind or on top of the upward displacement might also be done this way, perhaps???

I am awfully terrible at maths (one of my greater frustrations when studying biology), as you can probably see in the attached screendump of my feeble attempt at functions to get foam at certain depths. Can anybody shed some light on a better approach?

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: Matt on April 17, 2009, 03:48:15 AM
There currently isn't a way to get the altitude of the terrain below the water. In your configuration Get Altitude would return a value associated with the surface of the lake, not the terrain below it. Actually, Get Altitude compares a surface position with its original undisplaced surface position (because this gives the "altitude" of a terrain when applied to a planet), so on a lake object this would return the wave displacement function.

Matt
Title: Re: Coastal waves/foam thru functions?
Post by: Kranky on April 17, 2009, 05:15:48 AM
You can use the "Get terrain altitude", but you have to do this with your terrain. It's hard for me to explain - so look at the file in the attachment... this is my method to create waves. You can optimize and adjust the functions so that you get your needed shape. :)
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 17, 2009, 05:39:09 AM
Thanks for explaining Matt, and thanks for your testfile, Kranky. I'll have a look at it.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 17, 2009, 04:30:32 PM
Great question.  I actually tried this EXACT thing nearly a year ago to create foam near the edges of the water, based on altitude (as are real breaking waves).  I was unsuccessful, and Matt's input now explains why.

Matt, any plans to resolve this?
Title: Re: Coastal waves/foam thru functions?
Post by: Kranky on April 17, 2009, 06:11:41 PM
@moodflow: I'm not Matt, but you can look at my attached testfile in my above post.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 17, 2009, 07:05:35 PM
Thanks for posting the tgd Cranky. I've been looking at the effect away from the shore, were it looks like you have ripples over the whole water surface, rather than just increasing in amplitude at the shore edges.

Looking at your node network, it would seem possible you could trick the system to work. I'll have a play with it over the weekend as it ties in with something I've been playing with today, that being getting white horses on peaks of waves, which I think I've managed. I used a compute terrain after the water shader fed into a surface shader set at minimum altitude. have a look at the attached image, excuse the land, haven't realy spent much time on that.
Title: Re: Coastal waves/foam thru functions?
Post by: old_blaggard on April 17, 2009, 07:09:40 PM
I did this for my Boundary Waters image to control the depths to which my little ripples went out (http://www.terragen.org/gallery/displayimage.php?pos=-5397). I used a surface layer on the terrain to define a mask based on the terrain depth, and then used the resulting color values (stripped of all displacement - that's important, because having anything other than color data there messes things up for the following bit) as a mask for the displacement function for the waves, which itself was created with functions. I don't have time to look at the example file, so forgive me if I'm just repeating what's already been said, but this method has worked well for me.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 17, 2009, 07:20:16 PM
Looks like there could be a solution using a combination of both methods to achieve the ripples along the edge contour of the landscape fading out into the sea.

So OB, what did you use to create the wave displacement? Was it a bitmap of concetric rings?
Title: Re: Coastal waves/foam thru functions?
Post by: mogn on April 17, 2009, 11:06:50 PM
@Dune: It's a pity that this does not work. You uses some conversion nodes, that's not needed. Most conversions are implicit.
Some conversion can be used in tricky ways to simplify the network, e.g length(scalar(x)) instead of multiply(scalar(x),sqrt(scalar(3)).

















Title: Re: Coastal waves/foam thru functions?
Post by: old_blaggard on April 18, 2009, 12:31:31 AM
Hetzen - I constructed the concentric network using function nodes.
Title: Re: Coastal waves/foam thru functions?
Post by: Kranky on April 18, 2009, 08:00:04 AM
Quote from: Hetzen on April 17, 2009, 07:05:35 PM
Thanks for posting the tgd Cranky. I've been looking at the effect away from the shore, were it looks like you have ripples over the whole water surface, rather than just increasing in amplitude at the shore edges.

Looking at your node network, it would seem possible you could trick the system to work. I'll have a play with it over the weekend as it ties in with something I've been playing with today, that being getting white horses on peaks of waves, which I think I've managed. I used a compute terrain after the water shader fed into a surface shader set at minimum altitude. have a look at the attached image, excuse the land, haven't realy spent much time on that.

Of course you have to build more complex functions to limit the waves and decrease the size far away from the shore. The testfile is as easy as possible to show how to get waves. My own network looks like this:
(http://www.abload.de/thumb/nodes8s5b.jpg) (http://www.abload.de/image.php?img=nodes8s5b.jpg)
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 08:52:07 AM
Cheers Kranky.

Looks kind of involved. What further stages are you using to develop the technique? I undestand the displacement of terrain with the sin function, then taking the terrain away from that, just leaving the modulation (the reason being that it then can be conditional to altitude compared to the lake altitude), so I guess that's what the other functions are doing.

I suppose you could also somehow shear the distortion to create a rolling wave shape, or laterally space out the sin peaks with a boolean function clipping the modulation half way up it's positive range. Hrmm, food for thought.

Is there any way of decreasing/increasing the frequency within the sin function?
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 09:41:29 AM
Ok, I've answered my own question with the Sin function, I think. The higher the input, the higher the frequency. To increase the amplitude, you then multply the output.

Here's a little progression on Cranky's .TGD. It's not right, but it's giving me a better understanding of this, and shows how higher inputs into the Sin function the closer to the shoreline works, and does indeed proove his method as being workable.

Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 10:38:54 AM
Sorry to hijack this thread somewhat, I'll be happy to post the fruits of my labours here as a TGD. Could someone help me with something....

Is there a way of determining whether a vector is positive or negative in it's direction? The application here would be to apply a bias of something like .9 on the Sin rise then .2 on it's fall. Is this possible?
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 18, 2009, 11:28:36 AM
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!
Title: Re: Coastal waves/foam thru functions?
Post by: neuspadrin on April 18, 2009, 12:14:16 PM
wow this is getting impressive.

what would be reallllly awesome is if we could mimmic ocean waves/surf.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 12:20:09 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 18, 2009, 12:33:16 PM
Nice work Hetzen!  I'm trying to do the same, but haven't gotten that far yet.  Exciting stuff!
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 18, 2009, 12:48:57 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 01:15:38 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 18, 2009, 01:36:09 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 18, 2009, 01:47:53 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 18, 2009, 02:23:41 PM
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
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 02:40:50 PM
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.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 03:08:53 PM
@ 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.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 18, 2009, 03:51:56 PM
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
Title: Re: Coastal waves/foam thru functions?
Post by: 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
Title: Re: Coastal waves/foam thru functions?
Post by: mhaze on April 19, 2009, 10:09:44 AM
Nice!!! keep up the good work
Title: Re: Coastal waves/foam thru functions?
Post by: Tangled-Universe on April 19, 2009, 11:05:36 AM
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
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 19, 2009, 11:26:25 AM
Excellent work Dune. I'd also like to have a look at where you have taken that file.
Title: Re: Coastal waves/foam thru functions?
Post by: cyphyr on April 19, 2009, 01:21:29 PM
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
wow :)
Title: Re: Coastal waves/foam thru functions?
Post by: jo on April 20, 2009, 01:52:06 AM
Hi guys,

This is looking pretty good :-). People ask me if I going to make WaterWorks for TG2 and my usual response is "Would like to if I had the time, but you can actually create the same effects as WaterWorks using the function networks" and there you go :-). Of course you can also do much more in TG2 as well.

Regards,

Jo
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 20, 2009, 01:13:15 PM
Waterworks would be more ideal though, instead of all these complicated connections, so if you will ever find the time, Jo  ;D

I did some more work, and came up with the following image (here 70% of 1600 pixels wide; 8 hours rendertime @ detail 0.5 and AA 5). I still need some changes in the beach foam though, it's too 'wormlike'. Added some morning veils of fog for fun.

If anyone can work out how to decrease the amount of foam towards deeper water, or get more realistic beach foam, I'd be happy to know.


---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: Tangled-Universe on April 20, 2009, 03:02:32 PM
Hey Dune,

Thanks a bunch!
I agree with you that Waterworks would be ideal.
I'll see if I can make some adjustments to the foam and if so I'll post it here.

Martin
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 20, 2009, 03:31:08 PM
This is looking really nice, but I still think it needs a lot of work. 

The "foam" lines would actually taper off in deeper water since no waves would be breaking out there due to the water depth.  Many thanks for posting your file.  I'll see if I can make this work when I get some time (or maybe someone else may beat me to it!).

And Jo, yes, a waterworks-like option in the water shader would be incredible, especially for those like me who like to avoid using function nodes as much as possible!   ;D
Title: Re: Coastal waves/foam thru functions?
Post by: srb2001 on April 20, 2009, 03:33:31 PM
Quote from: Dune on April 20, 2009, 01:13:15 PMIf anyone can work out how to decrease the amount of foam towards deeper water, or get more realistic beach foam, I'd be happy to know.

Great work, Dune.

Could you use a greyscale gradient based on an aerial capture (quick lo-rez render) of the coastline, with a gradual falloff in black/white values away from the shoreline?  This could be easily prepared in Photoshop and then brought back into TG2 to have its luminosity control the density or opacity of the foam.

Just a thought ... I'm not savvy to TG shader construction yet.  But we use similar techniques in 3D cgi all the time (Lightwave & MAX).
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 20, 2009, 04:19:04 PM
Thanks Dune, will have a play tomorrow.

@SRB2001, yes, I'd think that could be a solution, but what's interesting about this approach, is that a node network should be able to determine distance from shore. For several reasons, like if I want to change camera angles through an animation, or want to apply these nodes to a different landscape, or whether I want to put a rock outcrop in the shore line.

What's really interesting here, is that the waves are concentric to the shore line. We just need to be able to blend this off through the function set up, which seems to be acting strangly the way this has proceeded. Ultimately, it would be good to work on things like wave overhang (curl), or have a constant that would change the wave spacing, or like Moodflow has put across, change the position compared to land for the breakers. It would be good to work this out without having to paint it manually.
Title: Re: Coastal waves/foam thru functions?
Post by: srb2001 on April 20, 2009, 05:07:54 PM
Quote from: Hetzen on April 20, 2009, 04:19:04 PM@SRB2001, yes, I'd think that could be a solution...It would be good to work this out without having to paint it manually.

Got it, Hetzen.  Being a visual artist, I tend to think more in terms of graphic matte preparation for composite work rather than algorithmically, like the coders or shader tree developers.  It would be great to eventually get such complex dependencies as you've enumerated into some sort of preset macro for "plug & play" use by the TG community, should it be developed to that level of maturity.

I saw the Vue7 breakers demo, and they seem to have the issue licked.  Would TG's shoreline waves animate along this contour-concentric pattern you've accomplished?
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 20, 2009, 07:27:02 PM
The animation side of things shouldn't be two much of a problem, except I doubt it would look realistic without a whole lot of fudging. As I said a few posts back, I doubt I'd want to use TG for realistic caustic simulations. TBH, I'm not sure there's much out there that could handle such a complex set of particle conditions without throwing a lot of resource at it, Realflow for example. I think, at the moment, it would be a lot cheaper to film. But that's not the point here, I like the concept of breaking the limits of a program, to achieve something that is not meant to be possible, and may, like you suggest, be added as a feature in future updates of a shader, or give the program designers some steer that could be used to reach maybe a higher step in that simulation process.

But more importantly for me; to get a better idea on how this bloody program works. ;D
Title: Re: Coastal waves/foam thru functions?
Post by: jo on April 20, 2009, 08:27:49 PM
Hi guys,

For a falloff using functions instead of messing around with gradients etc. try using the bias node:

http://forums.planetside.co.uk/index.php?topic=3175

or the gain node:

http://forums.planetside.co.uk/index.php?topic=3176

These two functions give some nice curves for falloff and such.

These are actually what I used in WaterWorks, and that was part of the reason I added them to TG2. IIRC I applied it various ways. For example in Sorta Surf it faded off the density of the foam from the front to back of the wave. You could also use to fade off waves further from shore and so on and such like. Very handy functions.

Regards,

Jo


Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 20, 2009, 08:42:32 PM
Thanks Jo. I used the bias function in that node setup to give a smoother edge into the cutoff point, to cap the wave depressions so that I had more distance between the sin peaks. What would be cool in this application, is identifying whether the sin function is in a positive rise or negative fall to give the sin a bias of .8 on its front end and say a .2 on it's exit. What did become weird, and it's quite probably me going into math head spin, is how all the scene altitudes went funny in the preview window. I had set up the function, as did Kranky, with the water altitude set at 100 meters, anything after that registered -390ish meters. Which didn't make a lot of sense.

Also, would it be possible to create a new node, that gives real time value feedback in the preview. Ie, I setup a "preview output node" in scaler/colour/vector at the end of some functions, so when I roll my mouse around the preview, it shows me it's output. Just as a debug tool. Would help to get some bearings on things, especialy when altitude drops by 400 metres for some reason.
Title: Re: Coastal waves/foam thru functions?
Post by: jo on April 20, 2009, 10:11:35 PM
Hi Hetzen,

Have you experimented with the Notifier node? You won't get the real time feedback from the mouse, but it may be possible to set it up so that it triggers when a certain point in the scene you're interested in is being evaluated.

Regards,

Jo
Title: Re: Coastal waves/foam thru functions?
Post by: mogn on April 20, 2009, 10:27:27 PM
@Jo Thanks for pointing out the notifier node, I did'nt know it existed.
Title: Re: Coastal waves/foam thru functions?
Post by: Oshyan on April 20, 2009, 10:52:56 PM
One thing to consider is that, although there is a lot of node trickery involved at this point, in the future when we add "macro" support, you ought to be able to encapsulate an easily adjusted version of a complex node network in a simple package. So this would essentially be like a "waterworks", except that one of you might create it. ;D

Quote from: srb2001 on April 20, 2009, 05:07:54 PM
I saw the Vue7 breakers demo, and they seem to have the issue licked.  Would TG's shoreline waves animate along this contour-concentric pattern you've accomplished?

Which demo is that?

- Oshyan
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 21, 2009, 02:53:51 AM
I agree with Hetzen about that "a node network should be able to determine distance from shore", instead of masks, and in fact it does in the wave sinuses. I would think the same could be used to have the foam taper off. But I haven't figured that out. It would be great if we ended up with a clean and clear TGC to be plugged in as a waterworks-workaround, which would work in all circumstances, and is adjustable to certain needs. Just like Oshyan said.

The other thing I would like to have is a constant added somewhere to increase the breaker height. I tried something with an 'add' before and after the sin function, but it didn't work (for me). And perhaps some sort of 'twist and shear' to get the overhang controlled, with more overhang on the breakers closer to shore. The problem with the current twist and shear is that it works one way, not in a direction compared to shallow-deep water. You cannot plug anything into it.

And perhaps something to get foam where the water's edge meets land (or objects), yes, we're very demanding... The foam on my beach is now a surface layer in the shaders list, carefully placed where the water meets land, but it should really be 'on the water'.

I'm very curious where we'll end up.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: srb2001 on April 21, 2009, 11:09:07 AM
Quote from: Oshyan on April 20, 2009, 10:52:56 PM
Quote from: srb2001 on April 20, 2009, 05:07:54 PM
I saw the Vue7 breakers demo, and they seem to have the issue licked.  Would TG's shoreline waves animate along this contour-concentric pattern you've accomplished?

Which demo is that?

http://www.e-onsoftware.com/products/vue/vue_7_infinite/videos/Small_Island_.html
Title: Re: Coastal waves/foam thru functions?
Post by: Tangled-Universe on April 21, 2009, 11:21:53 AM
What a crappy demo  :-\ It's way too fast and only the last 2-3 seconds are good enough to actually see the function. Too short.
What I can say from those 2-3 seconds is that it doesn't look bad at all (for a new feature in dev).

Martin
Title: Re: Coastal waves/foam thru functions?
Post by: kaisersuzuki on April 21, 2009, 01:31:08 PM
That feature is not in development if that is what you meant by "for a new feature in dev".  Foam generation like that demo is in current release.  I agree it is a crappy demo though.
Title: Re: Coastal waves/foam thru functions?
Post by: srb2001 on April 21, 2009, 02:01:12 PM
I have an older (RealWave 2.0) version of RealFlow's water surface generator.

It uses greyscale mapped sequences to perform wake sims based on collision detection of objects, particle sprays, or shoreline features:

# Creating RealWaves
# Emulating Large Bodies of Water
# Emulating Small Bodies of Water
# Adding Fractal Waves
# Adding Spectrum Waves
# Adding Control Points Waves
# Using Hypermesh
# Custom RealWave Meshes
# Controlling Object Buoyancy in Waves
# Creating Foam Textures
# Creating Wetmaps from RealWaves
# Static Points
# Particle Layer
# Coastline Features
# RealWave Object Properties
# RealWave Particle Interaction
# RealWave Particle Emission
# RealWave Splash Emission
# RealWave and Python Scripting

Pretty full-featured.  No wave curls like Arete/DNT Psunami may have had, though, as far as I know.
Title: Re: Coastal waves/foam thru functions?
Post by: Tangled-Universe on April 21, 2009, 04:53:12 PM
Quote from: kaisersuzuki on April 21, 2009, 01:31:08 PM
That feature is not in development if that is what you meant by "for a new feature in dev".  Foam generation like that demo is in current release.  I agree it is a crappy demo though.

That it is in a current release doesn't mean it is not in development. Especially because it is released for the first time in Vue 7.

I think the best example for this is Terragen 2 self. Many things/features available, but all still in development and further being improved/worked on.
Title: Re: Coastal waves/foam thru functions?
Post by: Oshyan on April 22, 2009, 01:18:46 AM
Ah, I thought you were talking about a curling/crashing waves demo. I've seen that other vid and frankly wasn't that impressed. It's good that it has some level of fluid sim, and it gives acceptable results, but it's not showing anything new. Not that we are at present either in that area, I just thought that's what you meant since the conversation had turned to breaking waves. ;)

- Oshyan
Title: Re: Coastal waves/foam thru functions?
Post by: srb2001 on April 22, 2009, 01:16:16 PM
Here's Nils Thürey's 2007 paper on simulating curls, foams, and wakes utilizing heightfields.

Might be germane to TG's implementation?

http://graphics.ethz.ch/~thuereyn/download/nthuerey_070503_realtimeswswaves.pdf

http://graphics.ethz.ch/~thuereyn/download/nthuerey_070503_realtimeswswaves.mov

He develops fluid sims for the Blender Project.
Title: Re: Coastal waves/foam thru functions?
Post by: Oshyan on April 22, 2009, 06:27:25 PM
Yea, I was quite interested in that paper. Not sure if it's something we could directly implement at any point, but it does occur to me that the eventual availability of the SDK might allow something like that...

- Oshyan
Title: Re: Coastal waves/foam thru functions?
Post by: folder on April 24, 2009, 08:31:13 PM
hey guys, I was playing with the changes made by Dune and Hentzen ( ie removed 2nd foam layer, wave settings etc) and came up with the following, which is what i needed for the water in this scene. btw any suggestions as to the bare area and stones will be appreciated
Title: Re: Coastal waves/foam thru functions?
Post by: rcallicotte on April 24, 2009, 10:29:58 PM
Just my opinion, since I'm not sure what you're aiming to do - the water needs less opacity. 

Any chance of seeing how you got here with the water?  This is an all around promising scene.
Title: Re: Coastal waves/foam thru functions?
Post by: folder on April 24, 2009, 11:25:55 PM
Calico

no problem here is the tgd file

I changed foam surface, removed extra foam layer, and changed some settings in the colour, bubble displ shader.  changed settings in the water shader. I also agree that opacity needs work, whatever you can so. I am currently rendering the whole scene and will post in images when finished

folder
Title: Re: Coastal waves/foam thru functions?
Post by: folder on April 24, 2009, 11:32:53 PM
calico

surface layer 03 connects to stone base

folder
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 25, 2009, 02:41:28 AM
What about any bright ideas about getting the depth from the land and using this as a basis for wave displacement and foam dispersal?? I thought I found something (see attached render, but don't look at the horrible land), but it only seemed to work with a fractal based terrain, not with an imported TER or generated terrain.

I don't really understand what the difference is in output between fractals, TER or generated terrain/eroded terrain. Anyone? If you attach a surface layer/distribution layer as a blending mask for the water/foam layers to this output, you should be able to get foam and waves where you want them with the altitude/slope settings. But there's only a difference (no foam/all foam) at 0 or 0.0001 altitude, not around waterlevel and downwards. I almost give up, but I hope for some bright mathematician to come up with the final solution!
Title: Re: Coastal waves/foam thru functions?
Post by: Mohawk20 on April 25, 2009, 03:17:25 AM
I hope you'll at least continue on fractal terrains, because this looks great!
Title: Re: Coastal waves/foam thru functions?
Post by: reck on April 25, 2009, 04:57:57 AM
Quote from: srb2001 on April 22, 2009, 01:16:16 PM
Here's Nils Thürey's 2007 paper on simulating curls, foams, and wakes utilizing heightfields.

Might be germane to TG's implementation?

http://graphics.ethz.ch/~thuereyn/download/nthuerey_070503_realtimeswswaves.pdf

http://graphics.ethz.ch/~thuereyn/download/nthuerey_070503_realtimeswswaves.mov

He develops fluid sims for the Blender Project.

This is what I did with the fluid sim quickly in Blender to test it out. The simulation does look good I think.

http://www.vimeo.com/1788541

http://www.vimeo.com/1730968
Title: Re: Coastal waves/foam thru functions?
Post by: Mohawk20 on April 25, 2009, 07:30:15 AM
Wow, that looks really great...
Title: Re: Coastal waves/foam thru functions?
Post by: moodflow on April 25, 2009, 11:42:37 AM
Dune, this is starting to come together.  Keep this going!
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 25, 2009, 04:07:18 PM
Looking good Dune. Best image yet.

I've not had much chance to get back involved with other commitments and projects on, but have had some new ideas on the functions side of things, which I'll have a play with the latter end of next week. I think I want to roll back a little from the white horses for the moment, because I think there is more scope with the node network, particularly with determining wave direction to change the shape of the wave's front from the back. Plus using the altitude return to trigger certain characteristics of surf formation. Just air guitar thoughts from the car on the way to work at the moment.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 25, 2009, 04:13:21 PM
Interesting work Reck. Not sure how you'll get that to work within TG, or how long it would take to calculate that in real world units on exported terrain. At some point there's always going to be some form of fudge factor to get this to work, especially in any sort of animation.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 25, 2009, 04:30:32 PM
Quote from: jo on April 20, 2009, 10:11:35 PM
Hi Hetzen,

Have you experimented with the Notifier node? You won't get the real time feedback from the mouse, but it may be possible to set it up so that it triggers when a certain point in the scene you're interested in is being evaluated.

Regards,

Jo

Sorry missed this Jo.

The problem is, is that I want to know where that certain point in the scene is. Like what values are being returned by the sine function, at the moment I'm guessing it's cyclical between -1 through 0 to 1 and back again. But that's just a guess and makes designing these things difficult without any guidance through a/ real time feedback or b/ any meaningfull documentation. I really don't think it would be too hard to impliment.
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 26, 2009, 02:05:48 AM
I too have little time to experiment, but seem to be drawn back to the swells/foam ever again. I just want to understand, I even dreamed about nodes last night  :-\ Wasn't too horrible.

Today, besides finishing an oil painting, I'll see what happens if I put a constant in place of the get altitude. And see what happens if I make a surface layer after base colours, implement certain height restrictions, attach it to something that makes x and z coordinates, then to the foamshader, or convert to color again. Something like that. That's the only way I do this thing; by trial and error and some vague understanding. The mask way works, but then the colour of the foam fades to gray where the mask fades, and it should only fade the appearance. And when you haven't got the mask proper, it's more work to get it exactly right. So it's still the nodes that should do the trick.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 26, 2009, 05:37:14 AM
I made a simple foam dispersal setup for anyone to experiment. If anyone can get the foam to disappear over the red area, he/she deserves a place in the book of fame! The red area, of course, should not be visible in the end, only the coastal foam. Don't forget to first make the heightfield with the current settings.

This is the last I will be doing, as I'm getting kind of disturbed over this issue.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: rcallicotte on April 26, 2009, 07:24:53 AM
GROOVY!!!  Thank you so much.  Now, to learn...

;D

Quote from: folder on April 24, 2009, 11:25:55 PM
Calico

no problem here is the tgd file

I changed foam surface, removed extra foam layer, and changed some settings in the colour, bubble displ shader.  changed settings in the water shader. I also agree that opacity needs work, whatever you can so. I am currently rendering the whole scene and will post in images when finished

folder
Title: Re: Coastal waves/foam thru functions?
Post by: rcallicotte on April 26, 2009, 07:28:59 AM
Reck, that is great work, especially using a free program.  Brilliant!
Title: Re: Coastal waves/foam thru functions?
Post by: pfrancke on April 26, 2009, 12:32:54 PM
Dune, please don't give up!  You've got the best waves and water out there.  I am very poor at TG, so please take this with a grain of salt (I might be not understanding something here)  I took a look at your last basic tgd file (so that I might learn from your techniques) and I did note a what I think is a problem with the POV that you selected - which is adding a confusing variable to all this.  I think your POV is right on the edge of the radius of the lake instead of on the edge of an island that is inside of your lake.  Back your POV further back and you'll see what I'm saying.

Regards,
Piet
Title: Re: Coastal waves/foam thru functions?
Post by: pfrancke on April 26, 2009, 12:44:45 PM
Further rambling from someone who is very lost in even thinking about this...  my fear is that it is difficult to make anything happen based on an elevation check, because the reported elevation is that of the surface of the water (top of waves), not the surface of the ground under the water.
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 26, 2009, 03:10:48 PM
Hi Piet,

I'll have a look at the POV, but what you say about the altitude is my fear as well, hence my challenge to the wizzkids. On the other hand, if you have a surface shader there's the possibility to give the soil at a certain height a colour (see my red-stained underwater area), why can this (coloured area) not be translated to the water plane (actually the attached foam layer)? I tried all sorts of functions, another water shader, colour to vector, vector to colour, etc, etc. No luck so far.
Perhaps mixing to worlds together, one with the water, one without, where the altitude is based upon the waterless world and transferred to the waterworld might do it, I don;t know... just another wild guess.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: pfrancke on April 26, 2009, 03:47:11 PM
I think I got a little closer to this... see the attached tgd, I changed the pov - but key was hooking up the compute terrain to the "perhaps more foam" input node and then using altitude constraints.  So the check is looking at true surface (instead of water surface), but the foam is still applied to the water surface.  But I'm getting some black spotches in the red area now (but that might not matter as it is under water. 
Title: Re: Coastal waves/foam thru functions?
Post by: pfrancke on April 26, 2009, 03:53:41 PM
Sorry for bombarding this thread --

I updated the pov in the attached tgd to be away from lake border -- Also, I learned bunches from this - but am not sure if I was helpful

Piet
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 27, 2009, 04:19:10 AM
I have attached a new (same name) TGD, but the problem remains; how to get a translation from real land depth/altitude to a masking/blending layer for the foam. What you did, Piet, was not the right way, at least it didn't work for me. The foam should somehow disappear over the red area (or the not-red waterplane). This is just a basic setup to have a good view what happens when you get to experiment. First generate the land.

---Dune
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on May 26, 2010, 11:00:26 AM
This little problem has been swilling around my mind for a while now, and I think I've made a breakthrough in terms of wave shape, and in particular getting a breaking curve on the front of an incoming wave. Still needs a lot of work yet, but I'm fairly confident that I can get these waves to crash against a shore slope, I have full control over the height, back & front wave width, where on the wave I want to put displacment and the curl. All of which will be driven by the get frame node. ie it animates.

Things to do: Convert the Get X function to work from Get Altitude. Get some Perlin noise to affect the distance between waves as well as animate the offset of when they rise/fall and break. Animate a small segment and see how the backwash might be simulated. Then start texturing. (With this little set up, I can put a mask anywhere on the wave)

I'm thinking of not using the water shader at all on this, as I figure white foam is going to cover any transparent parts, which means this won't be a monster to render. Hopefully.

Anyway thought you guys might want to have a look.

Cheers
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on May 26, 2010, 01:29:31 PM
Hey Hetzen, that looks very interesting! Blue nodes, I suspect. You'd have to break up the regularity by PF, but I look forward to some more inside info!
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on May 27, 2010, 09:54:08 AM
Yeah looks interesting. It would be good to see if we can bolt on your work in pf textures, seeing I've found a way of animating PFs without keyframes. And yeah, there are some blues in there ;)

Just a quick update. I've now got the altitude and frame number to move the waves in shore. There's a hard cut-off at 0m atm. I'm now working on getting the PF which modulates the concentric(ness) to modulate over time.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on June 10, 2010, 05:58:13 AM
Just an update on the surf animation....
Title: Re: Coastal waves/foam thru functions?
Post by: FrankB on June 10, 2010, 06:05:58 AM
looks super cool - if you can find a way to breakup the clean front-line of the broken wave rushing forward, it will not look CG anymore.
Anyway, we have never seen somebody achieve something that good with waves, yet. You can be proud of yourself, really!  :)

Regards,
Frank
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on June 10, 2010, 06:12:58 AM
Yeah it does need some work. What I need to do is sync the breaker with the surf, which is going to be interesting  :D

Also, more variation in the height of the beach will help.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 22, 2011, 08:42:13 PM
I made some progress with this today after leaving it on the shelf for a while. There's a static noise in this render which needs to go, but the movement isn't a million miles away.

There's a few refinements needed, like accelerating the wave's lateral movement when it reaches it's peak, which should make breaking water faster than the rest of the wave. The animation a few posts up I'd like to incorporate with this one as well, somehow getting the water plane to rise up a beach, then recide.
Title: Re: Coastal waves/foam thru functions?
Post by: Oshyan on April 22, 2011, 09:01:17 PM
Impressive, that looks quite good (although a bit hard to tell details at the low resolution).

- Oshyan
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 22, 2011, 09:43:02 PM
That's kind Oshyan. I've set an 800 frm render tonight, to see how long the fractals hold up, which I'll try and stick on Vimeo tomorrow. The detail isn't too bad, but I don't think this will hold too close to the waves. There's some popping displacements which I'm not too sure what to do with them yet, maybe as a last resort, render out a displacement animation, then batch frame dust and scratches..
Title: Re: Coastal waves/foam thru functions?
Post by: Oshyan on April 22, 2011, 09:47:27 PM
Might be able to fix the displacement issues with some tweaked render settings. I'd have to see what you're referring to specifically to know.

- Oshyan
Title: Re: Coastal waves/foam thru functions?
Post by: Kadri on April 22, 2011, 09:48:18 PM

Hetzen , this looks very promising .
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 22, 2011, 10:06:23 PM
Quote from: Oshyan on April 22, 2011, 09:47:27 PM
Might be able to fix the displacement issues with some tweaked render settings. I'd have to see what you're referring to specifically to know.

- Oshyan

I'm using a get normal to find the wave facing, which I suspect is the culprit. It could be a case of tweaking the patch size in the compute terrain to solve. Or animate a doctored mask.

I'll see if 'displacement tolerance' on the water plane object, helps on a problem frame.
Title: Re: Coastal waves/foam thru functions?
Post by: monks on April 22, 2011, 10:09:34 PM
Very very nice!

monks
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 22, 2011, 10:46:29 PM
Thanks monks/Kadri.

Here's the above animation in better rez.

http://vimeo.com/22763488

I'll probably have @600 out of that 800 tomorrow.
Title: Re: Coastal waves/foam thru functions?
Post by: Dune on April 23, 2011, 02:13:16 AM
That is amazing, Jon. Congratulations on your job! I've been at it for a while as well, but my math won't stand up to yours. I only found a way to get 'ridged' waves following the coast, which can be blended with the normal sinus, but the curling is still done by twist and shear shader, and only possible into one direction, i.e. local.
Perhaps your method can be implemented in the software itself in due time, would be great!
Title: Re: Coastal waves/foam thru functions?
Post by: bobbystahr on April 23, 2011, 10:59:11 AM
Wow...I'm gob smacked by this...too beautiful and a few tweaks away from real waves...way t' go mate.. ...
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 23, 2011, 02:03:24 PM
Thanks guys, but I don't think I've cracked it yet. There's another 400frm animation to upload as soon as Vimeo sorts itself out.

I wanted to see where and how the PFs will fall down, it's a fine line getting the movement to variation, and when I can get the latest rendering up, you'll see what I'm talking about.

Even so, I've got some more ideas which should address some of the problems.
Title: Re: Coastal waves/foam thru functions?
Post by: microwar on April 23, 2011, 08:22:52 PM
Looks very realistic first, and then nature starts to freak out  :o

Very impresive !
Title: Re: Coastal waves/foam thru functions?
Post by: gsmith on April 23, 2011, 11:47:40 PM
Brilliant work ;) I have a hard time getting any foam on my ocean surface at all, you seem to pretty much have it mastered hehe.
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 24, 2011, 07:37:30 AM
Lol at microwar, you're not wrong. Things go a little hectic towards the end.....

http://vimeo.com/22784540
Title: Re: Coastal waves/foam thru functions?
Post by: monks on April 24, 2011, 09:34:10 AM
heh, yes towards the end looks a little unrealistic- but that kind of stuff could work for very turbulent water, like stormy seas, etc. It's like wind action.

monks
Title: Re: Coastal waves/foam thru functions?
Post by: mhaze on April 24, 2011, 12:41:18 PM
every 7th wave....  Great work
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on April 24, 2011, 06:34:21 PM
Quote from: mhaze on April 24, 2011, 12:41:18 PM
every 7th wave....  Great work

I kind of got the syntax wrong on that, it should be the height of the wave, is one 7th of the wave frequency. (on average, and yes, waves do compress when you consider back draw (?)).

The above was just playing around with PFs, so it was a finger in the air on the look. What this won't do atm is follow coastal relief, which is possible with Dune's approach. Using sine waves will eliminate the need to use get normal to displace by, which is a big ask to displace something then to have the program to look at the slope direction on rendereing to influence the previous displacment. Which is why there's popping geometry.
Title: Re: Coastal waves/foam thru functions?
Post by: RedSquare on April 24, 2011, 10:26:34 PM
I admire your tenacity in attempting this.  You are both approaching something worth while methinks.   8)
Title: Re: Coastal waves/foam thru functions?
Post by: inkydigit on May 16, 2011, 10:11:13 AM
very interesting and impressive!
Title: Re: Coastal waves/foam thru functions?
Post by: sjefen on May 16, 2011, 10:46:34 AM
Very impressive work  :o

Regards,
Terje
Title: Re: Coastal waves/foam thru functions?
Post by: freelancah on May 16, 2011, 12:39:34 PM
Wow. This is really incredible work!  :o
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on May 16, 2011, 05:52:12 PM
We've got a new tool. ;D

Looking forward to jumping back on this.
Title: Re: Coastal waves/foam thru functions?
Post by: rcallicotte on May 17, 2011, 09:40:38 AM
Wow Hetzen.  Thanks for the shock and encouragement.   ;D
Title: Re: Coastal waves/foam thru functions?
Post by: FrankB on May 20, 2011, 03:52:03 PM
Quote from: Hetzen on April 22, 2011, 10:46:29 PM
Thanks monks/Kadri.

Here's the above animation in better rez.

http://vimeo.com/22763488

I'll probably have @600 out of that 800 tomorrow.

Hi Jon, I have just seen this for the first time. Missed it somehow. Jon, this is amazing!!!

Cheers,
Frank
Title: Re: Coastal waves/foam thru functions?
Post by: Hetzen on May 24, 2011, 07:41:08 AM
It can be done Frank. I just need to free up some time to play with this some more.

I just got back from holiday, so not been around this weekend. It was good to meet up the other day.

Cheers

Jon