0
$\begingroup$

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

enter image description here

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: enter image description here

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: enter image description here

$\endgroup$
  • 2
    $\begingroup$ Can you explain why you need your own setup and set the image texture to clip instead of repeat? $\endgroup$ – bstnhnsl Jun 26 '18 at 14:55
  • $\begingroup$ I'm developing my own complex Node groups and need this option to be more flexible. $\endgroup$ – Christoph Werner Jun 26 '18 at 15:36
  • $\begingroup$ And to answer your question about setting the image texture to clip instead of repeat: if you set it to repeat and use the modular function, then gap distance is not possible to set because "repeat" overwrites this and let the texture keep visible. You will see it if you reproduce my node tree. $\endgroup$ – Christoph Werner Jun 26 '18 at 17:38
3
$\begingroup$

Blender's modulo doesn't work well on negative values I guess. Shame, but it's fixable.

enter image description here

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:

enter image description here

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

enter image description here

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.

$\endgroup$
  • $\begingroup$ Thank you for your tip. Interesting, but not exactly what I'm looking for. Or I may miss something in your setting. See my description image above for more details please. $\endgroup$ – Christoph Werner Jun 26 '18 at 18:57
  • $\begingroup$ Okay, see the edit then. $\endgroup$ – Nathan Jun 26 '18 at 19:33
  • $\begingroup$ Hi Nathan. Thank you for your time. I think I've still not described my wish well. Maybe it's because of my english. Your solution is nice but don't solve my problem. I prepare a blender scene and put it here, to show you what the actual problem is. One time more I will try to explain what I would like to have in other words: I would like to have a solution to use a single bitmap as a repeatable pattern. Additionally I would like to set the distance between every repeated tiles, in all directions and "slide/move" the whole pattern on the uv map. it should work with generated UVs too. $\endgroup$ – Christoph Werner Jun 27 '18 at 7:50
  • $\begingroup$ .blend link added in my 1st post. $\endgroup$ – Christoph Werner Jun 27 '18 at 8:55
  • $\begingroup$ Don't forget: If you add just an Absolute node after the Modulo function, then you get a mirrored result. It's ok so far, but need two more changes: 1. Mirrored again, to be displayed right 2. The first negative tile must start shifted, because of the tile distance. I know the basics, but am not able to do this myself and would like to learn it in this way. $\endgroup$ – Christoph Werner Jun 27 '18 at 9:13
2
$\begingroup$

Ok then. After some "brain compiling" and additional experiments I think I have the solution I wanted.

What you can do with this cycles nodes tree:

  • This setup repeat a bitmap texture endless in all directions, starting at the 0 coordinate on an existing UV page or generated UVs.
  • Beside this you can shift the complete repeated pattern.
  • Additionally you can set an equal distance between all tiles.
  • The pattern size/amount can be altered too.

Hope it help others too.

Best wishes and stay creative! Chris

enter image description here

And here the .blend file:

$\endgroup$
  • 1
    $\begingroup$ To be honest, I don't think that this screenshot is useful to others. If possible, please share a simplified version of the file, there are too many possible errors while rebuilding the node tree $\endgroup$ – brockmann Jun 27 '18 at 13:30
  • $\begingroup$ Of course. Done. $\endgroup$ – Christoph Werner Jun 27 '18 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.