# How to Convert Coordinate Inputs to Negative or Positive Numbers With Texture Nodes

My goal is to make a procedural diamond plate texture, and I want to make it as simple as possible. So, if I can help it, I don't want to just duplicate my Diamond-Shape node group and angle it the other way.

In a nutshell, I want my Vector Rotate node to alternate rotating the diamonds by 45 or -45 degrees. I figured out a way to get 1 or -1 based on an odd or even input using this equation: 2(x % 2) - 1 (you can see my best node representation of the equation in the Value-Alternate node group).

The problem is, I don't know where I get x, or my input. In other words, I don't know if I need an input node or if I need to do some math with the grid vector. I think I need to be able to adjust each diamond in the grid individually.

My complete node layout:

Diamond-Shape node group:

Value-Alternate node group:

Here's a reference:

• I don't know of any way to do it without duplicating the diamond shape group. This is what I managed to do with it imgur.com/a/nirB2FB basically, i duplicated it, rotated it and gave it a bit of offset then mixed it with the original. Mar 4, 2022 at 6:42
• The reason is that if you (somehow) rotate every other one of your diamonds as you say, you won't get something like your reference. Mar 4, 2022 at 6:47
• As @mqbakamqbaka says, you have to do one of the following things: 1. Duplicate the node group, rotate the output of the second and mix them together with Multiply or Maximum for example, or 2. duplicate the node group, make it a single user and change the internal 45° to -45° and mix them together like mentioned before or 3. if you want a single node group, open the node group and edit it by duplicating the internal process thread, one for 45°, one for -45°, and mix them together inside the group. Mar 4, 2022 at 7:59

You will need to duplicate your diamond shape group

The reason for that is that the pattern of your texture doesn't really match the pattern of the reference. Here is why :

This is how your texture looks now (our diamonds have a lightly different shape due to the Vector curves node that I couldn't reproduce exactly) :

If you rotate each other diamond like you said, you will get either of those two here :

And none of those really look like the reference. The reason is that you actually managed to reproduce "half" of the reference, see :

The other half is just like the first half but rotated and with a bit of offset.

This is how I would do it :

First, I modified a bit your diamond shape group so that we can rotate the diamonds. I did that by adding a Vector Rotate node before the Vector Curves :

I added the angle of the rotation and your Normalize node as an input of the group for convenience. The normalize node actually controls the size of the diamonds so I named the input "diamondSize".

Using this node group with an input angle of 90°, I got the rotated version of the diamonds :

I can then mix them with an Add Node :

They are overlapping because I haven't offset the second one yet. They need to be offset about half of your tiling size on X and Y, which can be done by just adding a Vector Math Add after the Scale Node at the beginning :

giving this :

But the diamonds are too big, but since I exposed the diamondSize, I can change it by setting it to .15 instead of .3 :

I can feed that to the bump node to have the result :

Now all that is left to do is tweak the Vector Curves to shape the diamonds to your liking :

EDIT

I'll also suggest you to invert the output of the group node before plugging it to the bump node because, right now (if I copied your node setup accurately), your diamonds are going downwards instead of going upwards (White is up and black is down).