17
$\begingroup$

I'm trying to make a texture tiling mirrored as you can do in Internal. It seems that it's not so easy in Cycles. I want this:

enter image description here

Note that besides the A1 square you can see the same square mirrored, as well as in the G8 one and any other square in the texture's limit.

Is there any way to achieve this in Cycles?

$\endgroup$

4 Answers 4

2
$\begingroup$

Update December 2022

In Blender 3.5, the Image Texture node has a new mirror extension type (see here). So you can finally just set the Texture node to "Mirror".

Image Texture node with set to Mirror

$\endgroup$
11
$\begingroup$

You can achieve this usign math nodes:
Click for full size nodes

Edit: I have just seen you can even leave out the modulo operation. I thought it would make the coordinates repeat between 0 and 1 but it just does nothing.

Here is the .blend file for you.

What this node setup does is basically flip the UV coordinates when the image border is reached.

Result (with multiple flips):

enter image description here

$\endgroup$
5
  • $\begingroup$ Thanks! It works perfectly, even better than Internal! :D Just a little more question, how you can even made that node setup from scratch? It's crazy :P $\endgroup$ Commented Jan 20, 2015 at 12:59
  • $\begingroup$ Well, I just thought about what happens to the texture coordinates and translated that to math nodes ;) And I had to solve similar problems for an image processing lecture, so I already had a rough structure for the calculations in my head. $\endgroup$
    – maddin45
    Commented Jan 20, 2015 at 13:05
  • 1
    $\begingroup$ @AntonioBuch recommend you watch: cgcookie.com/blender/cgc-courses/… to understand all the math :) $\endgroup$
    – Greg Zaal
    Commented Jan 20, 2015 at 15:20
  • 1
    $\begingroup$ I'd also recommend watching this talk from the blender conference: youtu.be/kAUmLcXhUj0 $\endgroup$
    – gandalf3
    Commented Jan 20, 2015 at 22:22
  • $\begingroup$ That's awesome, but took me a while to notice that the second input of the power node is used instead of the first. Also your .blend file is no longer available. Try the blender stack exchange dedicated server. $\endgroup$ Commented Dec 6, 2016 at 17:12
11
$\begingroup$

Blender 2.82 added a new Pingpong mode to the Math node, which simplifies maddin45's answer. Make sure to set the scale on the Pingpong nodes to 1.0.

Mirrored tiling setup using Pingpong nodes

$\endgroup$
2
  • $\begingroup$ Is there a way to make this apply to the UVs after they've been affected by a UV Warp modifier? $\endgroup$
    – ArrowCase
    Commented Dec 11, 2020 at 3:00
  • 1
    $\begingroup$ @ArrowCase The UVs coming out of the UV Map node already have the UV Wrap modifier, so this does apply after the UV Wrap. $\endgroup$
    – scurest
    Commented Dec 12, 2020 at 14:37
9
$\begingroup$

I would propose a simpler set-up, pay attention to the highlighted values:

enter image description here

It basically uses two Mapping nodes and one Vector Math node. Note that the first mapping node is optional, just for pre-transformation:

$\endgroup$
5
  • $\begingroup$ Nice, that looks even cleaner and avoids splitting the coordinates. $\endgroup$
    – maddin45
    Commented Jan 20, 2015 at 13:06
  • $\begingroup$ does this work for more than just 4 repeats? $\endgroup$
    – Greg Zaal
    Commented Jan 20, 2015 at 15:21
  • $\begingroup$ @GregZaal Right, I admit the current result is not exactly the same one as BI does. I think maddin45 got better point. Btw, do you think it is still possible by following my idea? $\endgroup$ Commented Jan 20, 2015 at 16:48
  • $\begingroup$ @LeonCheung It doesn't work for me when I'm tiling either by increasing the mapping scale or the UV projection scale :-/ $\endgroup$ Commented Jan 21, 2015 at 11:34
  • $\begingroup$ @AntonioBuch, Yes, like I said to GregZaal, it is not perfect. I'll try to figure it out. $\endgroup$ Commented Jan 21, 2015 at 15:40

You must log in to answer this question.

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