メインコンテンツまでスキップ

checkerTile: Binary Checkerboard Pattern Tiling

Alternating binary pattern generation

The checker tiling function generates alternating 0/1 patterns from tile coordinates. For tile indices (z,w)(z, w), the function computes the checkerboard value using modular arithmetic:

c=(zmod2,wmod2)c = (z \bmod 2, w \bmod 2) checker=cxcy\text{checker} = |c_x - c_y|

This produces a binary output where adjacent tiles have opposite values, creating the classic checkerboard pattern.

Binary Output Mapping

Tile Index (z,w)(z,w)zmod2z \bmod 2wmod2w \bmod 2$c_x - c_y$Pattern
(0,0)(0,0)000000Black
(1,0)(1,0)110011White
(0,1)(0,1)001111White
(1,1)(1,1)111100Black

High Contrast Checkerboard

ライブエディター
const fragment = () => {
      const pattern = checkerTileVec2(uv.mul(8))
      const color = vec3(pattern)
      return vec4(color, 1)
}