Moiré
This document is still in progress, may contain errors, and is for preview only.
Moiré generating dense interference fringes from two rotated grid layers with video-reactive phase modulation.
Left: unprocessed source. Right: Moiré applied.
Overview
When two periodic patterns are overlaid at slightly different pitches or angles, the result is a third pattern that doesn't exist in either original — a phantom structure that emerges purely from interference. This phenomenon is called a moiré pattern, from the French word for a watered silk textile whose chatoyant shimmer arises from the interference of warp and weft threads. Moiré is simultaneously a precision alignment tool, a visual artifact that print technicians spend careers avoiding, and — in the hands of Op Art pioneers like Bridget Riley and Victor Vasarely — a medium for kinetic visual illusion.
The Moiré program generates two independent grid layers on the FPGA, rotates each to an arbitrary angle, and superimposes them using one of four interference modes. The result is a monochrome pattern field that shifts and shimmers as the grid parameters change. Input video can modulate the phase of Grid B, embedding the source image into the interference structure. A DDS (Direct Digital Synthesis) accumulator animates Grid A's phase offset from frame to frame, creating slow spatial drift even with static input. The output is composited with the input via a wet/dry crossfade.
At zero video modulation, Moiré is a pure pattern generator — the output depends only on the grid pitches, angles, and combination mode. As Video Mod increases, the input video warps the interference fringes, bending straight grid lines around luminance contours. The result sits in an unusual space between synthesis and processing: a generated pattern that responds to incoming imagery.
Background
The Physics of Moiré Interference
Moiré patterns arise whenever two periodic structures sample each other at slightly mismatched frequencies. The visible fringes represent the beat frequency — the difference between the two spatial frequencies. Just as two tuning forks at 440 Hz and 442 Hz produce a 2 Hz audible beat, two grids at 32-pixel and 34-pixel pitch produce wide fringes whose spacing corresponds to the difference frequency. The closer the pitches, the wider the fringes; identical pitches produce a uniform field.
Rotating one grid relative to the other introduces angular interference. Even at identical pitches, a slight angle offset creates diagonal fringes. The fringe direction is perpendicular to the bisector of the two grid angles, and the fringe spacing is inversely proportional to the angle difference. This rotational sensitivity is why moiré patterns are used in precision alignment: a fraction-of-a-degree angular misalignment produces clearly visible fringes.
Coordinate Rotation and Grid Evaluation
Each grid layer is constructed by rotating screen coordinates through a 2D rotation matrix: , . The FPGA uses a 32-entry signed lookup table for cosine and sine (8-bit values scaled by 127), so the rotation angle is quantized to 32 steps across 360° — effectively 11.25° per step, though only 180° of unique orientations are exposed via the control range.
After rotation, the coordinates are reduced modulo the grid pitch to produce a cell-local position. A simple threshold at half the pitch generates a square wave — bright where the position falls in the first half of the cell, dark in the second half. This creates the fundamental stripe pattern. For dots (Grid A) or circles (Grid B), both axes or a distance metric are evaluated instead of just one axis.
Grid Shape Variants
Grid A offers lines or dots. In line mode, only the rotated X coordinate is evaluated, producing parallel stripes. In dot mode, both X and Y are evaluated and ANDed, producing a checkerboard-like dot matrix whose orientation follows the rotation angle.
Grid B offers lines or concentric circles. Circle mode replaces the directional coordinate evaluation with a Chebyshev-approximated distance function: