I want to create a rain on window effect for an animated wallpaper. For this reason it needs to loop.

I am going for something like this:

rain on window effect

In the end, it doesn't need to be exactly the same but I would like to have static raindrops and ones running down.

As far as rain on window goes there are some tutorials that use shaders and some that use particles. My question is how I can make either of those loops?

  • 3
    $\begingroup$ Your question is pretty general. Could you add some screenshots of references that look like what you are going for? there are unlimited ways to create "rain on a window" and multiple ways to make them loop. $\endgroup$
    – bstnhnsl
    Aug 5 '21 at 10:11
  • $\begingroup$ I am going for something like this In the end it doesn't need to be exactly the same but I would like to have static raindrops and ones running down. $\endgroup$
    – TomMaier
    Aug 5 '21 at 10:17
  • $\begingroup$ youtube.com/watch?v=4XJHc5xUFoM&ab_channel=CrossMindStudio and youtube.com/… might help you get started $\endgroup$
    – James
    Aug 5 '21 at 11:07
  • 1
    $\begingroup$ My question is less about how to do it and more about how to make it loop. $\endgroup$
    – TomMaier
    Aug 5 '21 at 11:16

If using a shader..

If your animation can stand being mixed over itself without losing realism, you can split it into identical A and B rolls, of loop length.

'B's jump is over the beginning and end of the loop. 'A' is time-shifted by half the loop length, so its jump is in the middle of the loop, and it's continuous over the beginning and end.

Then you cross-fade the rolls in such a way that 100% A covers the jump in B, and vice versa.

This can be done with a node group:

enter image description here

The yellowish nodes are the A roll, the Modulo means every time it reaches 'Period', it starts again from 0. The addition of 'Period/2' means it starts from halfway along.

The Ping-Pong does the cross-fade. It's arranged so the outputs can be connected to a mix, of some kind, between colors, or parameters. or shaders. and the cuts will be covered.

To use this with Amin Missaoui's lovely node-group, you have to tweak his group slightly, and bring the internal #frame driver out to the interface, so you can use the group twice, offset, for A and B:

enter image description here

It doesn't work too badly. But of course, you could use the same principle in any animated procedural shader of your own. You may not be mixing duplicate shaders.. it could just be colors, or UV's, normals, or whatever works.

A 50-frame loop:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.