# Seamless animation of Wave procedural texture

Following advice from this question on Stack Exchange I’m now able to seamlessly animate generated textures. I’m now using these methods to animate stripes via the Wave texture.

Something that I’ve noticed is that the stripes only will appear seamless if the scale is set 1.88889 or multiples thereof (see gif below). Is there significance to this number? What does it relate to?

You wrong. Perfect number is 1,884955781 ( or Pi / 5 * value in modulo )

For answer the question, first you need to know, that exactly Wave Texture node do.

So I build in simpler nodes exact copy of Wave Texture node:

This node setup produce similar result as Wave Texture node, and you can check this:

So now we can follow the nodes, to know where 1.8888 is hidden.

We begin in modulo coordinates here, from reference question. As i see, you have 3 repeats, so I think you set 0.3333 in modulo. You didn't give any information about it, but it's looks like that I'm right.

x,y,z now is from 0 to 0.3333.

Next stop is my node setup, in first nodes texture coordinates are multiplying with the result of this two:

First, multiply 10: 0.3333*10=3.3333

Next it is our X-number, that you think is 1.8888. I call him X, so result is 3.3333*X.

Last stop - sine. You need to know, that Sine repeats in 2*Pi period. So now we can get eaquation:

3.3333*X=2*Pi


So X will be:

X=(2*Pi)/3.3333

X=1,884955781


So, you wrong. perfect number is 1,884955781

• I don’t think this is correct - since Sine tepeats, why the Modulo function? I think the value used in the modulo will affect the ‘perfectness’ of the wrapping. This answer is certainly along the right lines but not mathematically correct. Aug 8 '18 at 15:00
• @RichSedman Modulo is goes from reference question. He used it for tilling. As you see, He have 3 repeats, so module must be 0.33333. Aug 8 '18 at 15:03
• @RichSedman check my blend file, if you think, that I'm not right. Aug 8 '18 at 15:09

@Crantisz's answer is almost correct - in that 'pi' is related to the required scale factor. However, the correct value is actually pi / 5 - ie, approximately 0.628. For seamless faces you should use a multiple of that (note : 2*pi/3.33333 effectively reduces down to 6*pi/10 or 3*pi/5 - 3 times the ‘base’ factor).

Using the above scale (pi/5), coordinates in the range 0.0 to 1.0 will map to a seamless texture. This means that you could use this to map two separate cubes using Generated coordinates as follows :

Similarly, the above scale can be used for seamless quad UV mapped faces that cover the whole of the (0.0 to 1.0) UV range.

The factor '5' appears to have been chosen by the developers purely so that the wave texture is at a convenient scale with typical values similar to other textures (and is unrelated to the default scale of '5' in a newly created texture node).

Note that when entering the scale you should literally enter, say, 'pi/5' to generate the calculated value rather than typing the rounded result - for increased accuracy.

• Rich I am curious, what is your background with math? Aug 8 '18 at 22:55
• @icYou520 As a kid I loved maths and that developed into a love for computers and coding - which I’ve been doing as a career and hobby for many years. Aug 9 '18 at 6:26
• Coordinates are not in range 0 .. 1 because he used modulo from this question Aug 9 '18 at 7:23
• @Crantisz I don’t think you can infer the use of Modulo from this question as it is written - nor from the linked question. Perhaps from the answer to the linked question. The issue exists with the much simpler case of using the ‘raw’ generated coordinates. Perhaps hellocatfood could edit the question to make it explicit. Aug 9 '18 at 8:47
• I draw a conclusion from the gif which he provided Aug 9 '18 at 9:00