Foam Animation Test + .tgd

Started by dandelO, July 15, 2010, 11:00:39 PM

Previous topic - Next topic

dandelO

Nothing special, just messing around with some foamy effect methods. Might as well post it here.

Not really happy with it but, I'm still experimenting...

Nasty YouTube compression, sorry.
http://www.youtube.com/watch?v=SjszndvVowY

Cheers!

Oshyan

That's actually not a bad start!

- Oshyan

Dune


Henry Blewer

The sparkles seem a bit out of sync/place. But that said, this is really impressive.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Hannes

Really a good start. I noticed that there seem to be at least two "noise"-layers for the foam, right?
It looks a little odd that one of them is somehow moving horizontally and the other one doesn't. What technique did you use?

dandelO

Thanks, folks! :)

Hannes: There is only one noise for the foam. The warping of the wave fractal(whose colour output is used as the blending shader for the foam) is kind of rolling one way, while the foam sits up top and has a warp of its own as well. It's a bit awkward to look at but, actually sea foam does kind of move this way on top of the water.

WIP, as usual...

Cheers!

dandelO

#6
If anyone fancies a peek, here's a demo frame lifted from the animation. I've removed all animated parameters.

The scene has been heavily optimized for speed. You probably won't find any use for this .tgd other than to simply see the functions of the waves and foam(which is an extremely simple method, see the 'water' group).

Optimized parameters are as follows;


  • Planet node: 'Render Surface' = unchecked(this saves loads of transparency rendering cost).
  • Water shader: Transparency distance = 1e+008(It is this high so that there is still the appearance of transparency, there is no planet surface, you need such a high distance to see the atmosphere on the other side of the planet through the surface. ;) Just try it with the planet ground enabled and a sensible transparency distance of 20m, or so, you'll see a big difference in render time over faking the transparency with a value like this one uses and, there's pretty much no difference in output, except for speed.)
  • Atmosphere node: Samples = '6', sample jitter = '0'(dropping sample jittering smooths the noise/grain of the atmospheric reflections on the water here, whilst keeping extremely low samples for speed.
  • Render node: Pixel sampler AA = 2, non-adaptive samples(4/4), no pixel noise threshold(to milk the most out of the low AA setting.
  • GI: '0'.

[attachimg=#]

This frame took me 2 minutes to render, 800x500px on 2 cores. You high-end hardware guys will pop it out in seconds, I'd imagine.

.tgd: [attachimg=#]

The water node called 'surface layer' isn't really required here, although, it serves as altitude/slope distribution to the foam, if you need it. I could have left this surface layer out and added the small displacement to the foam fractal itself but I like to keep surfaces as their own layers with distribution etc. if I need it so, that's why it's there. No constraints are set in the demo(or in the animation, for that matter).

Cheers! :)

choronr


dandelO

Cheers, Bobbington! :)
Quite simple, really. Just an extra fractal merged with the water shader output. I'm still tuning, maybe you guys can get a more realistic motion going on the foam. Especially Meneer Glimmerveen and Herr Janetzko.
The 'Caribbean' animation foam was quite motivational in my efforts to try and simulate it myself.
This is nowhere close to that, hee-hee! :D Great work, Hannes. :)

dandelO

I'm now experimenting with intersect underlying for the foam on this as well, I'll keep it posted, if I can balance the thing correctly...

Dune

Meneer Glimmerveen is actually too busy at the moment (still filling up a medieval city), but it sure is tempting to dive into this foamy water.

Hannes

Thank you, thank you!! ;D
In my opinion it's necessary to let the foam move with the water. In my first tries I created a wavy water surface and then tried to create foam patterns where they belong. I didn't manage to get it look right. In real life foam appears where there are heavy dynamic turbulences in the water, for example where the water hits itself. Then the existing foam patterns are distorted by the water motion. This is very tricky to simulate, because most of the time when we try to create CG foam the patterns look like they were projected onto the water surface. Their motion isn't in sync with the water motion. It's a matter of mapping. TG doesn't seem to have some kind of mapping that lets a map or a power fractal be distorted in any direction by an animated displacement.

One day I had the idea to first create the animated foam patterns (power fractals) and then apply a displacement with the same power fractal with different settings (lower contrast, lower roughness), but the same seed, so the water is displaced where the foam appears.
I used transform shaders to animate the patterns and the water surface displacement. I animated them vertically to get some turbulence and a little (!) bit horizontally . It's necessary that the transform shaders for the foam and for the water surface have the same speed and direction to make it look real. I didn't finish improving this method, but I'm still working on this Caribbean thing, so when this NWDA contest is over I'll try to explain it a little bit more in detail.

Hannes

#12
Well, I had another look at your animation. I guess you did it like I wrote, didn't you? :-[
But there's something in the movement of the foam pattern that doesn't look right. Somehow a certain amount of foam is gliding over the surface. I didn't have time to check your tgd, but I'll do that as soon as I can.
Btw I like your optimized parameters.

dandelO

QuoteI created a wavy water surface and then tried to create foam patterns where they belong.

Yes, that's why I use the wave fractal's colour noise as the blending form to the foam, to keep it where the turbulence appears. At less displaced wave heights I increased the blending colour offset, this leaves the foam to expand and then dissipate over the flatter areas, as it would in life.
The trouble I am having is that the two noises do not warp in the same manner when the foam scales are so much smaller than the wave scales but, this leaves the impression that the foam is warping as a separate, independant surface to the waves. It leaves clear foam texture patterns that don't seem to fit the wave fractal(even when the same seed is used, because of the differing scales).

I've an inkling that using an independent warp shader(with a duplicated wave function, as the warper, with the same warp values as the wave function) on the foam then, warping the foam itself would be unnecessary. I'd need to make the foam's lead-in scale to a size smaller than the wave's smallest scale(small enough to disguise the foam pattern visibility, that is). The trouble with this is, jaggy noise from the tiny foam scales.

I've a couple of other approaches in mind, as well. I'll keep this posted...

dandelO

QuoteWell, I had another look at your animation. I guess you did it like I wrote, didn't you?

Well, pretty much yes. :)

As I said while you were typing, I'm going to try and lower the foam scale to a constant(1cm, or so), give it complete coverage, then warp that by the waves only, without its own warp tab being used. The small scale and complete coverage(still blended by the waves, though) should eliminate much of the pattern borders of the foam...