Planetside Software Forums

General => File Sharing => Water => Topic started by: mhaze on January 20, 2013, 06:09:56 AM

Title: foam
Post by: mhaze on January 20, 2013, 06:09:56 AM
Foam

Here's the foam tgd - have fun

Mick
Title: Re: foam
Post by: Kevin F on January 20, 2013, 06:26:04 AM
Quote from: mhaze on January 20, 2013, 06:09:56 AM
Foam

Here's the foam tgd - have fun

Mick

Thank you so much!
Title: Re: foam
Post by: Hannes on January 20, 2013, 06:42:27 AM
Oh great!!! Thank you!
Title: Re: foam
Post by: zaxxon on January 20, 2013, 11:34:21 AM
Thank you mhaze!
Title: Re: foam
Post by: Kadri on January 20, 2013, 01:05:16 PM

Thank you  :)
Title: Re: foam
Post by: TheBadger on January 20, 2013, 08:29:11 PM
thanks
Title: Re: foam
Post by: Martchi on January 20, 2013, 11:45:08 PM
merci!
Title: Re: foam
Post by: Dune on January 21, 2013, 03:08:43 AM
Interesting, Mick. Thanks for putting it up. It's rather the same setup as I used. I only added some tiny fake stones as foam bubbles.
Title: Re: foam
Post by: mhaze on January 21, 2013, 04:16:05 AM
The fake stones are a nice idea. The limpet model is crude so feel free to improve!
Title: Re: foam
Post by: Hannes on January 21, 2013, 05:09:18 AM
Seems to be a foam battle at the moment!
MHaze, if only I'd understand what you were doing :(
That node stuff is quite complicated. Vectors, scalar, voronoi...
Title: Re: foam
Post by: mhaze on January 21, 2013, 05:29:11 AM
The displacement to vector node is key the rest is just playing with colour and masking.  I've found that if I use the small preview window for each node I can visually see whats going on  it helps a lot!

The voronoi create the surf pattern.  The displacement to vector gives the high point of the displaced ground - the rocks and is used as a mask for the surf pattern.  BTW the same technique can be used to place white water in a stream or river.
Title: Re: foam
Post by: Hannes on January 21, 2013, 05:51:13 AM
Thank you for your explanation! I'll dive into that and I'll try to understand it.
Title: Re: foam
Post by: Tangled-Universe on January 21, 2013, 09:10:37 AM
Thanks for putting this up Mick.

I'll have a look at the blu'ish swells and such. If I manage to improve it I'll share it back here.
I really like this one a lot, so I might even consider rendering it huge'ish for print :)

Cheers!

Quote from: mhaze on January 21, 2013, 05:29:11 AM
The displacement to vector node is key the rest is just playing with colour and masking.  I've found that if I use the small preview window for each node I can visually see whats going on  it helps a lot!

The voronoi create the surf pattern.  The displacement to vector gives the high point of the displaced ground - the rocks and is used as a mask for the surf pattern.  BTW the same technique can be used to place white water in a stream or river.

Ha that sounds familiar :)
http://www.planetside.co.uk/forums/index.php?topic=15258.msg148701#msg148701

Displacement shader to vector is a really cool node.
You can also use it to subtract different parts of the node network from each other to create interesting masks for additional displacements or surfacing.
That's the true power of TG's node based system, it's so versatile :)
Title: Re: foam
Post by: mhaze on January 21, 2013, 09:49:44 AM
Shouldn't be too hard too improve it!  It has become a real mess here at home I've got blue upswelling foam but it is rendering painfully slowly with two water shaders in it!  When this has rendered I'm going to start afresh and see if I can find a simpler method
Title: Re: foam
Post by: Dune on January 22, 2013, 03:35:12 AM
Why 2 water shaders?
Title: Re: foam
Post by: mhaze on January 22, 2013, 06:28:31 AM
It seems that one is for the main water and one is for the upswelling foam - it works with some artifacts from ior I think.  But there must be a simpler way ....
Title: Re: foam
Post by: Jo Kariboo on January 22, 2013, 10:19:31 AM
Thank you mhaze !!!  :)
Title: Re: foam
Post by: choronr on January 22, 2013, 05:58:57 PM
Thank you Mick, never could get the kind of foam like this ...much appreciated.
Title: Re: foam
Post by: Dune on January 23, 2013, 02:53:58 AM
Regarding the 2 water shaders; I am now rendering a scene which involves some rather crude displacements, upheaval of foam. That takes a lot of time. I already moved the water shader to before the foam comes in (I earlier had it inversely blended by the foam areas, after the foam), set it to non-transparent, and added an additional non-RT reflective shader in the foam setup, and added an extra transparent no wave water shader for the frontal area, but still....
I see it's rendering the foam displacements behind the rocks, taking all that time, and then covering it with the rocks. An actual waste of render time. Of course I can manually mask out all not visible crude displacements, but an automatic mask would be easier.

Oops. Sorry to hijack your post, Mick, I'll stop here.
Title: Re: foam
Post by: mhaze on January 23, 2013, 03:27:03 AM
Please carry on. hope to see a solution sadly I'm getting frustrated by it and will soon have to give up due to other work.  I had thought of using a relective shader but have not yet got round to it. I had considered using dandelos masking method for water but the resultant complexity would have driven me nuts.  Automatic masking of water should really be a part of TG's basic code.
Title: Re: foam
Post by: mhaze on January 23, 2013, 08:15:14 AM
Whoopee!!!!  think I've solved it - pic rendering now but will take a while will post later
Title: Re: foam
Post by: dandelO on January 23, 2013, 10:10:26 AM
Hi, Mick. I have managed to have a full setup using a single water shader, with subterrain water omited too.
For the foam width, I used a smooth step scalar and a separate hard step scalar removes the water beneath the terrain. Give the hard step a slightly smaller value than the smooth width and use that as an opacity function from the displacement to vector. I'll do an upload later, if I can, with the entire clip...
Title: Re: foam
Post by: chefc on January 23, 2013, 10:20:49 AM
Ty Mich looks very promising
Title: Re: foam
Post by: Mor on January 23, 2013, 12:17:12 PM
Thank you very much Mhaze.
Title: Re: foam
Post by: mhaze on January 23, 2013, 02:16:54 PM
Cheers Dandelo - I will be very interested to see it.
Title: Re: foam
Post by: dandelO on January 23, 2013, 07:24:25 PM
I hope you don't mind me posting here, Mick, instead of starting another 'still, still more foam' thread.

Not sure if I'm doing this the same way as you guys have been as I haven't looked at any of the previous clips but it seems much the same as Ulco's displacement to vector method.
The smooth step makes the width of the turbulence falloff and the hard step removes the subterranean water. In this image I used constant vector width='75', and needed to use constant vector opacity='55' to adjust how close to the terrain the water is omitted.
* The opacity width should always be somewhat less than the falloff width. At a constant width of '25', an opacity vector of '20' was needed to pull the water back to just behind the point it meets terrain. In other words, adjust the opacity constant vector to suit, if you adjust the falloff vector.

Didn't spend any time on the waves or terrain, and there's no white-caps past the smooth step distance either here. That shouldn't be too hard to add of course, I just played with the shoreline. The water is a sphere so it is planetary, adjust the water-level with some displacement offset or, remove the sphere object and just use a lake/plane, if you prefer.

** Maybe the volume density is a bit much in the water shader here?

Image 2 is just to show the water with the opacity trick, all you can see is distant atmosphere where the terrain should be.

[attachimg=1]

[attachimg=2]

[attachimg=3]
Title: Re: foam
Post by: zaxxon on January 23, 2013, 09:37:49 PM
Those are exquisite Dandel0! Hopefully you would consider doing a Terralive session on this process. Wonderful!
Title: Re: foam
Post by: Kadri on January 23, 2013, 09:50:40 PM
Thanks  :)
Title: Re: foam
Post by: choronr on January 24, 2013, 12:53:17 AM
Thank you Martin.
Title: Re: foam
Post by: mhaze on January 24, 2013, 03:20:28 AM
Thanks Martin I shall have to study this
Title: Re: foam
Post by: Mor on January 24, 2013, 04:07:46 AM
Thanks a lot dandelO
Title: Re: foam
Post by: dandelO on January 24, 2013, 08:39:51 AM
I didn't bother using any outside functions for the wave pattern, it just relies on the random water shader fractal slope for where to add the white-caps, I'm pretty sure that I could make the waves follow the terrain a bit nearer the shore using a bit of displacement trickery, maybe you guys already have done, I just had a bit of a play with the volume/opacity on a simple water shader(which btw, can be easily animated with a transform node, the foam will always follow the shape of the water shader).
These white-caps don't really have any substance either, just a flat, white layer for now. Decent from this distance but closer up, you might want to add some displacement with a smaller scaled roughness function, or something.
I would prefer to only use one constant to control the width of the volume area and the opacity area, I think that instead of needing to adjust both constants, that I could simply divide the smooth step width constant by a fixed constant(probably 0.75?) which feeds the hard step scalar, I'll play around later with that as I just don't like the double width controls, it's not very intuitive.

Good fun, though. :)