Checker texture

Checkers and gradient textures are both super easy to do with pure math on the texture coordinates.

Initial scaling by 0.999 is so I don’t have to handle equality, which Blender is bad at. You could put as many 9s there as you wanted. Conversion to -1,1 range of modulos is a way of doing an XOR to get a 3D checker. This particular material is drawing something like a gradient across an imaginary diagonal for each checker “cube”. (The length of this diagonal is a constant, in the coordinate space in which we’re evaluating it: square root of 3 divided by 2.) Not designed for negative coordinates, as those require a correction to the modulo.

3 Likes