Planetside Software Forums

General => File Sharing => Topic started by: Denis Lemos on January 13, 2017, 09:57:48 pm

Title: Cloud Animation Loop
Post by: Denis Lemos on January 13, 2017, 09:57:48 pm

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". (

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!
Title: Re: Cloud Animation Loop
Post by: Dune on January 14, 2017, 02: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.
Title: Re: Cloud Animation Loop
Post by: Matt on January 14, 2017, 02:24:10 am
Very well done. Thanks for sharing it, and welcome to the forum!

Title: Re: Cloud Animation Loop
Post by: KlausK on January 14, 2017, 06:06:28 am
Hi Denis Lemos

This is great! Thank you very much for posting your findings.
cheers, Klaus
Title: Re: Cloud Animation Loop
Post by: Oshyan on January 14, 2017, 04:13:43 pm
What a great way to start on the forums here, by sharing a cool, advanced technique. Thank you and welcome!

- Oshyan
Title: Re: Cloud Animation Loop
Post by: Hannes on January 14, 2017, 04:39:16 pm
Wow, this is clever stuff. Thanks a lot!! To Jon too!
Title: Re: Cloud Animation Loop
Post by: bobbystahr on January 20, 2017, 09:02:24 pm
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...
Title: Re: Cloud Animation Loop
Post by: zaxxon on January 21, 2017, 12:23:54 pm
Wonderful! Thanks for sharing this and welcome to the Forum.
Title: Re: Cloud Animation Loop
Post by: Kadri on January 21, 2017, 12:28:02 pm

Thanks for sharing.