14
$\begingroup$

How can I make a radial checkerboard pattern like this in the shader editor?

enter image description here

$\endgroup$

2 Answers 2

18
$\begingroup$

One method is to use two checker textures, one driven by a radial gradient, and the other driven by a spherical gradient, then combine the two together using a mixrgb node set to difference. Here are the results and the node setup.

The result

The node setup

If you want something besides black and white, you can pass the output from the difference node into a color ramp with two colors.

Using a colorramp node to change the colors

If you want more than 2 colors, you can change the two checker texture nodes to be 4 different colors, then use a 4 node color ramp to adjust as needed.

creating a 4 color checker texture

$\endgroup$
5
  • 2
    $\begingroup$ Very nice :). You can actually use the Black&white output as a mask for any other color combination. $\endgroup$ Commented Dec 20, 2021 at 9:24
  • $\begingroup$ Agreed.. but I'm still trying to get my head round the logic :) $\endgroup$
    – Robin Betts
    Commented Dec 20, 2021 at 14:53
  • 3
    $\begingroup$ I'm seeing four colors - is this just an optical illusion thing? $\endgroup$
    – Arsenal
    Commented Dec 20, 2021 at 15:19
  • 1
    $\begingroup$ @Arsenal Looks like there's indeed a fourth light blue shade: i.sstatic.net/MaB3n.png $\endgroup$ Commented Dec 20, 2021 at 15:44
  • $\begingroup$ +Jachym Michal Thanks for the idea, I found that using a color ramp worked and updated my answer. $\endgroup$
    – deltaray
    Commented Dec 24, 2021 at 2:57
5
$\begingroup$

A method to get polar coordinates in general is to use the (0-1) output of a Gradient > Radial texture as X, and the Length of the XY coordinate as Y:

enter image description here

The blue nodes above are just to ensure X is always an even integer, and give the user a basic interface, should you want to group the cluster.

$\endgroup$

You must log in to answer this question.

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