Planetside Software Forums

General => File Sharing => Water => Topic started by: child@play on April 06, 2008, 06:40:13 PM

Title: fake foam pt. II
Post by: child@play on April 06, 2008, 06:40:13 PM
hi,

don't have much time with the software, but i stumbled upon a (maybe new) way to fake foam on water.

the water's surface layer is limited by slope, 5 max, and 2 fuzzy, have fun =)
Title: Re: fake foam pt. II
Post by: inkydigit on April 07, 2008, 03:34:16 AM
looks like a promising scene!
Title: Re: fake foam pt. II
Post by: rcallicotte on April 07, 2008, 09:35:11 AM
SWEET!

Where have  you been, ol' champ?
Title: Re: fake foam pt. II
Post by: child@play on April 07, 2008, 10:22:14 AM
work mate, almost too much. but it bought me a new render machine, laptop, so i can work a bit while at work :D

Title: Re: fake foam pt. II
Post by: rcallicotte on April 07, 2008, 11:14:51 AM
Enjoy life.  You only get one.  And I know we need to work.  So, anyway, BLAST OFF!!!
Title: Re: fake foam pt. II
Post by: child@play on April 07, 2008, 11:20:59 AM
yeah, i'm still working for a living, and not the other way round :D

i'm pretty confident that i'll be having more spare time in the future
Title: Re: fake foam pt. II
Post by: peejay on April 08, 2008, 01:03:51 PM
thanks for sharing - this looks great
Title: Re: fake foam pt. II
Post by: bobbystahr on April 09, 2008, 03:18:06 AM
beauty mate...been trying to stumble my way thru the sea foam issue with zero luck. This looks extremly promising..many thanks.. ...
Title: Re: fake foam pt. II
Post by: child@play on April 10, 2008, 09:37:38 AM
this is more flexible than i thought, you can easily change the foam's color by adding a color pf as the surface layers coloring function. green foam anyone ? ;) oil on water maybe :D


Title: Re: fake foam pt. II
Post by: PG on April 12, 2008, 06:59:22 PM
Any way to restrict this to a few meters from the terrain?
Title: Re: fake foam pt. II
Post by: lightning on April 12, 2008, 08:20:33 PM
cool thanks!
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 07:43:51 AM
Quote from: PG on April 12, 2008, 06:59:22 PM
Any way to restrict this to a few meters from the terrain?

yep, just adjust the surface layers settings accordingly, either you do so via slope and/or height restrictions
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 08:05:42 AM
but there's no altitude difference between the shore and the middle of the water, also the slope only restricts it to sections of the wave, so I still end up with soapy foam too far out, maybe masking is the only option.
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 08:21:15 AM
just running a quick test with distance shader, looks promising. here's the adjusted tgd and a preview shot.
you should be able to adjust the foam now by playing with the distance shaders settings


p.s.: sorry for the messy .tgd
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 08:50:42 AM
Would that only work with shots where the camera is close to the shoreline though? Here's what I've got so far, I only want the foam to soften up some of the hard water edges. It's already done that to a greater extent but I now want to restrict the spread a bit. As you can see from the render the foam just goes in a kind of straight line down the water.
Title: Re: fake foam pt. II
Post by: rcallicotte on April 13, 2008, 08:52:12 AM
Thanks child@play.  I'll see what I can do with this next TGD.    8)
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 09:00:42 AM
well, you should be able to just add another render camera, placed at the coast for example. if you take this new camera's output as the distance shaders camera input you should be fine
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 09:39:14 AM
hm, just nulled the effect of the fractal breakup on the surface layer.
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 01:23:23 PM
hm, it just nulled, or you just nulled?  ???  ;D
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 01:29:26 PM
lol. I mean that the fractal breakup was dividing up the foam quite nicely into little strings, but now it's just a large floating mist with quite a sharp edge with the rest of the water which is completely foam free.
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 01:32:58 PM
lol, what did you do? :D

attach your tgd please, so i can have a look at it, always hard to guess what went wrong ;)
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 01:56:21 PM
I'll have to redo it then, I just reverted back to the original.
Hm, can't remember how I did it, now I just get a big sheet of milky water, can't remember the settings I used.
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 01:58:48 PM
guess you defined the distance shader wrong, you'll definetly need to change the near colour to something deep blue, and the far colour to black, then play with the near and far distance
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 02:01:44 PM
Oh I see, yeah I didn't change the colours. I got the distances working quite well but didn't think about the colours. Here's the TGD, sorry it's a bit of a mess.
Title: Re: fake foam pt. II
Post by: child@play on April 13, 2008, 02:04:52 PM
Quote from: PG on April 13, 2008, 02:01:44 PMsorry it's a bit of a mess.

no problem, you've seen my messy tgd :D

i'll have a look at it in a couple, just waiting for a render to finish

edit: pg, you might try deleting the lake, and use a surface layer with water shader as childlayer, just like in the tgd i provided.

edit2: well, this method won't work with your scene-setup as it is, you would need to restrict your fake-stones distribution, so maybe stick with the lake and just use the setup like in my second tgd, dunno if it will work with a lake object
Title: Re: fake foam pt. II
Post by: PG on April 13, 2008, 07:35:14 PM
Tricky on isn't it :D I'm thinking that functions are needed here, get, add, inverse, all that malarky. Or there may be a way by using an object or a heightfield to provide a field to work in. apply the foam effect to that and then apply it to the input of the water shader, hiding the heightfield or object first but still keeping it in the heirarchy.
Title: Re: fake foam pt. II
Post by: child@play on April 14, 2008, 07:07:13 AM
yep, quite tricky, but the solution is out there :D let me know when you got it to work ;)