# How to get mirrored tiling in Cycles?

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:

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?

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

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

• 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 – Antonio Buch Jan 20 '15 at 12:59
• 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. – maddin45 Jan 20 '15 at 13:05
• @AntonioBuch recommend you watch: cgcookie.com/blender/cgc-courses/… to understand all the math :) – Greg Zaal Jan 20 '15 at 15:20
• I'd also recommend watching this talk from the blender conference: youtu.be/kAUmLcXhUj0 – gandalf3 Jan 20 '15 at 22:22
• 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. – ChameleonScales Dec 6 '16 at 17:12

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

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

• Nice, that looks even cleaner and avoids splitting the coordinates. – maddin45 Jan 20 '15 at 13:06
• does this work for more than just 4 repeats? – Greg Zaal Jan 20 '15 at 15:21
• @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? – Leon Cheung Jan 20 '15 at 16:48
• @LeonCheung It doesn't work for me when I'm tiling either by increasing the mapping scale or the UV projection scale :-/ – Antonio Buch Jan 21 '15 at 11:34
• @AntonioBuch, Yes, like I said to GregZaal, it is not perfect. I'll try to figure it out. – Leon Cheung Jan 21 '15 at 15:40