3

I followed this tutorial: https://www.youtube.com/watch?v=Jvbphr8EUYQ to create a fire material which basicly "runs" down a noise texture to create a fire effect.

so far so good, but I would like to create a perfect loop. with a little bit of googleing, I found out how to Loop a noise texture but my problem is now I lost the fire effect and just got this stationary wobble effect.

now to my question. whats the best way to perfeclty loop an animation like this? I can't wrap my head around the problem.

Can I mirror the noise texture somehow 4 times to after x time get back to "0" ? whats the best way to approach this?

Thanks a lot for your answers!

1 Answers1

3

The principle behind this method is described here, and even here, but the group to implement it wasn't conveniently packaged for re-use, so I think this repetition is excusable. It works if an animation can be mixed over itself without loss of desired characteristics.

It relies on cross-fading an animation with a copy of itself, cut in the middle. The right trim of the copy is moved to the left, and vice-versa, so its matching cut is over the ends of the loop. The cross-fade conceals the jump in the middle. This group will do it:

enter image description here

The red nodes are the shifted A-roll, the green node the un-shifted B roll. The blue nodes do the cross-fade.

It can be used like this, with the driver for both rolls being the frame-count:

enter image description here

Simply duplicating is the quickest way, but the A and B roll don't have to be identical, although they look better with the same speed in the direction of animation. In this example, for convenient tweaking, the fields of the 'B' noise are driven by the fields of the 'A' noise, to keep them matched.

enter image description here

This demo .blend includes the group:

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • I knew you would… :) The cross-fade technique is kind of cheap for your skill level though and I thought you would use a 4D torus technique - or that doesn't work, because in the end of the day, if you move in circles to return where you started, it doesn't matter how many dimensions you move in, there always will be a side-motion visible? We could simplify the problem to separate flames, and ensure if one doesn't disappear till the end of animation, it continues from the beginning. That would require calculating the lifetime of the flame based on the noise which definitely isn't trivial… – Markus von Broady Oct 25 '22 at 09:48
  • 1
    @MarkusvonBroady Hehe :D I did consider it.. Your objection, (and laziness) is why I didn't go for it. A circle is a circle, however many dimensions it's in, and I think you would see a reversal in direction. But I haven't checked , so now you've blown away my afternoon... >8-/ – Robin Betts Oct 25 '22 at 10:04
  • 1
  • @MarkusvonBroady EXACTLY! 8D ! – Robin Betts Oct 25 '22 at 10:17
  • @RobinBetts Thanks a lot for your explanation and demo-file, I will tonight try to understand each node and learn a lot from it! – user1258938 Oct 25 '22 at 15:35
  • @user1258938 call back if you get stuck :) – Robin Betts Oct 25 '22 at 15:39
  • @RobinBetts good day Robin, the last couple days I played around a lot with your great solution. I dont completly understand your math-magic yet, but I had great fun experimenting with it!

    to my new questions: When I use the noise-loop in a slower scene (for example for volumetric clouds) I do see in the middle of the animation a hard switch to the other noise texture b, Is there a workaround to loop it that they meet at the end of the loop and without a noticable break?

    my other short question would be, how did you connect the two noisetexutre values together?

    – user1258938 Nov 07 '22 at 22:18
  • Hi @user1258938 ! if you've set the period correctly, there are no cuts inside the un-looped material, and there is a way to mix the driven feature of the animation over itself, you should be fine. Send a minimal example of the fail via https://blend-exchange.com/, if you like. – Robin Betts Nov 08 '22 at 10:16
  • @RobinBetts here's my blender-file

    My problem is, I cant get rid of the "bounce" effect in the middle of the animation. Maybe you have an Idea how to improve the material to have a better flow for the animation. Thanks a lot!

    – user1258938 Nov 08 '22 at 18:25