I would like to achieve this in the Shader node editor :

I go with a wave texture and a color ramp nodes. In the color ramp node, I can adjust the POS of the gradient but this change the thickness of the bars for all the axis and not like a gradient.

What are your thought how would you solve this ?

Thank you very much,

• Is the picture what you obtain now or it is what you want to obtain? Feb 7 at 7:20
• It is what I want to obtain @lemon Feb 7 at 7:57
• A useful search term for you might be: 'half-tone' Feb 7 at 8:17

That can be this way:

Use the wave at some scale.

Shift the gradient input coordinates so that it start a bit later and scale it so that shift + scale = 1 (when X is 1).

Compare the two.

Wave goes regularly from 0 to 1.

Gradient go regularly from the shift to 1.

• Ah damn it, all my work is useless now :D The only difference is I did it without a Wave Texture, just the X coordinates. Feb 7 at 8:18
• Ah ah!! @GordonBrinkmann, we need no texture for this case, in fact. Feb 7 at 8:22

@lemon already gave a good solution, here is just an alternative method which I only give additionally to not feel having done the setup and screenshots for nothing :)

What you can do is use the Generated texture coordinates with a Separate XYZ node to get a 0 to 1 gradient. This value multiplied by for example 50 and plugged in a Math node set to Fraction will separate this in 50 repeating gradients from 0 to 1.

Then you can compare the values with, let's say 0.5 and to get an increasing wider range where the result is true, the Epsilon value needs to increase from left to right, this can be done with using the X coordinate multiplied by a value smaller than 1.

This is the basic setup and its result:

The factor with which you multiply the X coordinate will determine the width of the white lines and how much it increases from left to right. In the basic setup I multiplied with 0.3, below you see the result for 0.1:

But in both cases it starts very thin on the left side. To change that, you can put an Add node inbetween to increase the base thickness. Here you see the result with adding 0.3 before the multiplication:

You can also add 0.3 after the multiplication and get quite different results. But another thing you can do to change the overall appearance and results is instead of comparing to 0.5 maybe choose a different value. In the image below it's 0: