### Author Topic: Cloud Animation Loop  (Read 2431 times)

#### Denis Lemos

• Member
• Posts: 1
##### Cloud Animation Loop
« on: January 14, 2017, 01:57:48 AM »
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.

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

#### Dune

• Terragen Alpha Tester (Win)
• Posts: 14427
##### Re: Cloud Animation Loop
« Reply #1 on: January 14, 2017, 06:10:51 AM »
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

• Planetside Staff
• Posts: 3391
• I'm the crazy one
##### Re: Cloud Animation Loop
« Reply #2 on: January 14, 2017, 06:24:10 AM »
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

• Member
• Posts: 434
• Land ho!
##### Re: Cloud Animation Loop
« Reply #3 on: January 14, 2017, 10:06:28 AM »
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 780 / Win7 Ultimate

#### Oshyan

• Planetside Staff
• Posts: 12657
• Holy snagging ducks!
##### Re: Cloud Animation Loop
« Reply #4 on: January 14, 2017, 08:13:43 PM »
What a great way to start on the forums here, by sharing a cool, advanced technique. Thank you and welcome!

- Oshyan

#### Hannes

• Terragen Alpha Tester (Win)
• Posts: 4224
##### Re: Cloud Animation Loop
« Reply #5 on: January 14, 2017, 08:39:16 PM »
Wow, this is clever stuff. Thanks a lot!! To Jon too!

#### bobbystahr

• Member
• Posts: 9552
• Turn, and face the Strange Ch Ch Changes...D Bowie
##### Re: Cloud Animation Loop
« Reply #6 on: January 21, 2017, 01:02:24 AM »
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

bobbystahr

#### zaxxon

• Member
• Posts: 1092
##### Re: Cloud Animation Loop
« Reply #7 on: January 21, 2017, 04:23:54 PM »
Wonderful! Thanks for sharing this and welcome to the Forum.