Cloud Animation Loop

Started by Denis Lemos, January 13, 2017, 09:57:48 PM

Previous topic - Next topic

Denis Lemos

Hi!

Some time ago I needed loop-shaped animated clouds for a project. The cloud needed to end in the same shape it started, because the animation would play without intervals like a GIF. Since I did not find any examples of animated looping clouds, I decided to create this topic to help people who are in need of this too. The work I already finished long ago, but at the time I took a whole month to create this solution, because I am not an advanced Terragen user and had never worked with nodes.

I found in this topic an example provided by the user named "Hetzen".
http://www.planetside.co.uk/forums/index.php?topic=13948.0

In this exemple the cloud displacement is based on the number of the current frame in the sequence. And the amount(speed) that the cloud moves every frame will depend on the value you assign to the node within the group called "Set Cloud Speed", in the example the value is 10 meters per frame. If the frame number is zero will not move the cloud. When the frame number is 50, the clouds have moved 500 meters (10 * 50). So when rendering the last frame, which in the my example is 3000, the clouds have moved 30000 meters (10 * 3000).

Starting from this principle, I duplicated the group of nodes that does the animation of the clouds, except that in this group I did the inverse logic. In the first frame of the animation the clouds begin with maximum displacement(10 * 3000) equal to the last frame of the first group of nodes and it loses the displacement until arriving at the last frame of the animation and get the same shape that began in the other group.

After that using only basic math, I just mixed the two groups of nodes using the node called "Merge Shader". This node mixes the two animation groups based on a value between 0-1. If the input value is zero, it will show only the first group of animated clouds. If the input value is 0.5 it will show the two groups equally mixed. If the input value is 1 it will only show the clouds of the second group with the inverse animation.

The mathematics behind this is very simple, we need to pass as the input value the number referring to the current frame of the animation, but before we need to normalize the value between 0 -1 with the following calculation:
1.0 / SequenceSize * frame.

Then just render the animation, and like a magic pass we have a beautiful loop animation.




I'll attach the file with the example to get saved in the forum in case the direct download link no longer works.
Download Here

Sorry if my explanation was not easy to understand, my language is not English!

Dune

Thanks very much for the work you've done on this. No doubt it will be helpful for a lot of users. And of course, welcome to the forum. Great entry! Hope to see more of you here.

Matt

Very well done. Thanks for sharing it, and welcome to the forum!

Matt
Just because milk is white doesn't mean that clouds are made of milk.

KlausK

Hi Denis Lemos

This is great! Thank you very much for posting your findings.
cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

Oshyan

What a great way to start on the forums here, by sharing a cool, advanced technique. Thank you and welcome!

- Oshyan

Hannes

Wow, this is clever stuff. Thanks a lot!! To Jon too!

bobbystahr

Very clever indeed and thanks for walking us through your process...most instructive. Now I really got to get to animation...guys like you and hannes are an inspiration...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

zaxxon

Wonderful! Thanks for sharing this and welcome to the Forum.