9
$\begingroup$

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?

enter image description here

$\endgroup$

2 Answers 2

4
$\begingroup$

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:

enter image description here

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

enter image description here

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.

enter image description here

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:

enter image description here

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.

enter image description here

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

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$ Commented Aug 8, 2018 at 15:00
  • $\begingroup$ @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. $\endgroup$
    – Crantisz
    Commented Aug 8, 2018 at 15:03
  • $\begingroup$ @RichSedman check my blend file, if you think, that I'm not right. $\endgroup$
    – Crantisz
    Commented Aug 8, 2018 at 15:09
2
$\begingroup$

@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 :

seamless waves

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.

$\endgroup$
5
  • $\begingroup$ Rich I am curious, what is your background with math? $\endgroup$
    – icYou520
    Commented Aug 8, 2018 at 22:55
  • 1
    $\begingroup$ @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. $\endgroup$ Commented Aug 9, 2018 at 6:26
  • $\begingroup$ Coordinates are not in range 0 .. 1 because he used modulo from this question $\endgroup$
    – Crantisz
    Commented Aug 9, 2018 at 7:23
  • $\begingroup$ @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. $\endgroup$ Commented Aug 9, 2018 at 8:47
  • $\begingroup$ I draw a conclusion from the gif which he provided $\endgroup$
    – Crantisz
    Commented Aug 9, 2018 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .