Repeat texture in all directions using cycles nodes I'm struggling around with a small problem.

First what I want: I would like to make a bitmap texture repeatable in all directions using the cycles nodes.
it is important to create an own setup, and NOT using the regular Mapping node.

The problem: As soon as the bitmap texture is set to "clip" then the wrapping is not working in my solution. See my screenshot.

I have moved the starting coordinates and you can see the texture is not repeating in all directions. It will be duplicated to the positive direction only.

I know you can use the Absolute function to repeat it mirrored, but it is mirrored then... This is something nice for procedural textures but not well for bitmaps and often unwanted.

Do you have any ideas to do this in blender via cycles nodes?

Keep creative and thank you
Chris



The point is:
I want repeat AND set a distance between every repeated texture. My knowledge let me do this into the positive UV direction only. How do I do this like in my description below?

Here some more description, what I imagine:


Following is the Link to the .blend file.

After opening:
You see three Values at the left hand side. Tile Distance, Amount and Move X/Y.
Basically all works well, but the problem is: The tiles will be repeated to the positive axis only. I would like to repeat them endless in all directions and be able to set the tile distances and move the whole tile page position too.

Download .blend File

And here the shot for my scene example setup too:
Blender's modulo doesn't work well on negative values I guess.  Shame, but it's fixable.



We can do manual correction for negative UV by taking the absolute value, doing our modulo, then inverting it.

Note that I'm using a mixRGB node to mix these values, which is hacky, but works.  You could always multiply by fac/1-fac and then add the values if you want to be less hacky.

The only reason I can see that you might want to do this is to give different clip/repeat behavior in different axes, and there's an easier way to do that:



Edit: In order to create space between the images, we simply remap the UV after our operation.



Here, I'm scaling each picture down to half its original size, creating a full width border between each instance, and I've created a value node to easily control this value.

You specifically said, "No mapping nodes!" and I see no reason for that, but I've done it how you want anyways.  These math operations could be achieved as easily with a single mapping node as with a series of math nodes.