checkerTile: Binary Checkerboard Pattern Tiling
Alternating binary pattern generation
The checker tiling function generates alternating 0/1 patterns from tile coordinates. For tile indices , the function computes the checkerboard value using modular arithmetic:
This produces a binary output where adjacent tiles have opposite values, creating the classic checkerboard pattern.
Binary Output Mapping
Tile Index | $ | c_x - c_y | $ | Pattern | ||
---|---|---|---|---|---|---|
Black | ||||||
White | ||||||
White | ||||||
Black |
High Contrast Checkerboard
ライブエディター
const fragment = () => { const pattern = checkerTileVec2(uv.mul(8)) const color = vec3(pattern) return vec4(color, 1) }