1

Hi everyone and thank you for taking the time to read this.

I'm wondering how I could make this repeat on the X location, so that it doesn't just clip out of existence when I change the X value, think of image texture repeat rather than clip.

Any advice would be incredibly welcome, node setup below :)

Node Setup

  • https://blender.stackexchange.com/questions/135437/how-to-make-tileable-procedural-noise-texture https://blender.stackexchange.com/questions/26692/how-do-i-create-repeating-patterns-with-cycles-procedural-textures/26703#26703 – Duarte Farrajota Ramos Aug 16 '23 at 10:16
  • Hello and welcome. This question seems to have already been asked in various forms over time and already has a multiple answers, but you never acknowledged any of the existing posts. We are not sure if you aware of them but none of the described techniques fulfil your particular requisites, or you simply didn't do any research at all. Could you [edit] you post and clarify how your question differs from the suggested duplicates? Otherwise could you rephrase it to focus on a particular step you are stuck with? – Duarte Farrajota Ramos Aug 16 '23 at 10:16

1 Answers1

0

An Image Texture node samples the texture in a normalized $0…1$ space on both $x$ and $y$ axes (also called UV), where $0$ means (the center of) the first pixel (first row or first column) and $1$ means last pixel (last row or last column).

Well actually the second coordinate ($y$ or $v$) should have $1$ at the top, but I won't redo the image now that I realized my mistake ‍♂️

And so a question arises, if you try to sample a value higher than $1$ (or lower than $0$, i.e. a negative number) on either axis, what should happen?

  • Clip will just return (transparent) black
  • Extend will return nearest valid pixel (it will clamp the coordinate, so if it's greater than 1 it will be 1, if it's negative it will become 0)
  • Repeat will repeat the $0…1$ range:

I achieved the above line chart using Desmos with the simple formula $y=\operatorname{mod}\left(x,1\right)$, so that's what you want to do in Blender, except Blender's modulo is 1 lower for negative input (Looping Hue Animate), so use Wrap instead, or even better, Fraction, which is the same as Wrap with hard-coded $0…1$ range (discards the number to the left of the dot):

Beware of the problem that $1$ is mapped to $0$, and so you may want to check against this specific value and in such case output $1$ instead…

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
  • Hey there, thank you for the explanation here. Is there any way to get the tiles to be seamless as well with the provided method? The primary reason I'm asking is because this is meant to be a smoke like glow that will trace from the tip of a sword's blade, to its very top before dissipating (hence all the alphas, since it fades out.) because with the fraction solution, the tiles are seen and when I still change the X value of the texture coordinate, the effect still 'disappears' and doesn't repeat. – Raccoonmancer Aug 15 '23 at 21:25