Global Water + Animator

Started by dandelO, December 16, 2011, 09:52:10 PM

Previous topic - Next topic

dandelO

I had to make a sequence of animated water today or, I thought I did, I was informed afterwards that water will be handled in Realflow later so I'll share this little clipfile here, it's been a while since I uploaded anything of use.

It is pretty simple but effective and just uses a general water shader with a couple of control parameter nodes. Everything is clearly labelled as to what it's for, there's very little you need to know, really.
Load the clipfile as normal. This note vv is included in the clipfile so you can open it from inside the program for easy reference;

***
The sea is a sphere object set to the same radius and coordinates of the default TG2 planet.

- Water Level -
To control the depth, open the node 'Water Level - Offset' and go to the displacement tab.
Use the 'displacement offset' parameter to control the planetary height of the water in metres. Positive values raise the water level, negative values lower the water level.
The default setting here is; 'displacement offset = 10'. This makes the water 10 metres deep over the surface of the whole default planet, when there is no terrain.

- Animator -
For animation purposes use this node to scale/rotate/translate the water shader in any direction.

For both of the example image sequences I used; 'Translate Y = 5 metres per second' and 'Translate Z = -2.5 metres per second'.
To make the horizontal wave pattern, I used 'Scale X = 5' to stretch the water East/West.

All 'Animator' parameters are left at default settings when you load this clipfile so, you can stretch/rotate/scale them to fit your own scenes and needs.
***

Nothing more, really. The note is inside, and here's a small, low quality preview of the couple of variations described above;


[attachimg=#]

Cheers! :)

Dune

Looks good and sophisticated, Martin. Thanks again!

dandelO

Very welcome, Ulco. It's really simple, just transforming the water shader Y coordinate at a sensible rate gives a nice fluid motion.

I say 'Y=5mps' here(probably too fast a rate, you might think at first glance) because this water shader is scaled quite large and smooth, too small a scale in the water node makes too 'jaggy' a pattern, in my opinion and gives unrealistic and sharp results that can sometimes tend to not look like water, especially if you want a calm surface.
If you do lower the smallest scale, you'll need to drop that transform/mps value, as it will be moving way too fast for the small scale to transition comfortably and will look unnatural. Best to make a nice and sensible water shader and use the transform node to rescale that.

The fractal offset node is very handy because it gives you very precise control over water height. Using a 'Lake' node can be confusing for people as the water level and 'Y' value of the object node can differ, this won't happen when just using the sphere and a constant offset. All other settings in that fractal node can be ignored, unless you want to use it to add more variation, for now it is simply just a heigh control but feel free to play around with it, it doesn't hurt to experiment.

dandelO

One problem with using a sphere of water is the possibility of extra rendering beneath the terrain but you can always use a B/W opacity mask to localise where that surface renders, just like I showed in my 'masked water' examples a couple of years ago.

Dune

I use a final no color surface shader to collect all water/lake data and displace that offset to the water height needed. With a no shadow earth-size sphere indeed and a black default as a mask.

bobbystahr

Nice work Martin....makin' me really long for the full version but Santa didn't bring one....again....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

TheBadger

Wow man! Way to share! Would not want to sound greedy, but;) if you can do a similar simple node structure for your wind effect, that would be crazy. Hhmmm, I think at this point anyone who makes a film or TV spot with terragen2 will have to credit Martin for something.
It has been eaten.

digitalis99

Excuse me for being dense, but how can we get at the inner-workings of this clip?  Or, do you not want us to see that?
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

Dune

If a node has a plus sign, you right-click on it and choose internal...

dandelO

Quote from: digitalis99 on January 17, 2012, 06:58:24 PM
Excuse me for being dense, but how can we get at the inner-workings of this clip?  Or, do you not want us to see that?
Quote from: Dune on January 18, 2012, 03:32:35 AM
If a node has a plus sign, you right-click on it and choose internal...

Which none of these nodes do...

I'm not sure I follow you, digitalis99. All the workings are in the nodes you can see. The note describes how it is all controlled. I'm usually known to stash hidden nodes inside others to keep things tidy and out of the way if they aren't necessary to use. All the nodes here, though, are outside, in the general network because they are all control nodes, the fractal does nothing but raise/lower the overall water-level (via offset in metres) and the animator is just a transform shader that rolls/scales/rotates the noise of the water shader around whatever axis you want over time. There's really nothing more to this clipfile.

digitalis99

Then I'm *completely* missing how the animator moves anything over time.  I know you can enter values in the translate fields, but you'd have to keyframe those, right?  In other words, they wouldn't change automatically based on the frame number like my method does.
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

dandelO

Ahh, I see, yes, you're right. The water motion does require keyframing. I purposely left those fields blank for uploading here because each animation they're used in by anyone will likely require a different set of parameters/length of time/etc. It's just a case of working out how many frames are in your animation and then setting your mps for the motion. The rendered results above were something like 5m per every 25 frames over 'Y' and 2.5m over 'Z' for that water shader at the scales you find it in the clipfile.

Your way, to make a consistent movement according to 'get frame number', is better as a plug-and-play method. I just made this one quickly to fit a project I'm working on as a way to transform the water shader's noise gently and thought it might be useful to others who aren't so clued up on the functional blue nodes, since all that is required is a keyframed transform of the water surface.
Every 25 frames(1 second) I wanted the noise moved by about 5m so, over a 10 second animation I'd transform 'Y' by '50', between first/last frame.

As usual, many, many ways to skin a .tgd! ;)

digitalis99

Got it...that's making more sense to me, now.  I'll just stick with my blue node method of movement, since it doesn't require keyframing and it moves at a constant rate throughout the animation.

Thanks for posting this version, though.  The simplicity of it is helping me reduce the complexity of my method.
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

bobbystahr

Quote from: digitalis99 on January 18, 2012, 01:51:51 PM
  The simplicity of it is helping me reduce the complexity of my method.

and that's one of the great things about this forum
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

lat 64

Um...So,
I don't see where the clip file is. All I can download is the png screen grab. Did it go bye bye in the last few months?

I would love try to duplicate this, but I just don't know which nodes Dandelo used as control parameters.

Russ
I'm a half century plus ten yrs old. Yikes!