Skip to main content
Animated 2-color dithering over multiple pattern sources (noise, warp, dots, waves, ripple, swirl, sphere). Features various dithering algorithms including random and Bayer matrix patterns.

React Usage

Vanilla JavaScript Usage

Parameters

string
default:"'#000000'"
Background color in hex format.
string
default:"'#00b2ff'"
Foreground (ink) color in hex format.
'simplex' | 'warp' | 'dots' | 'wave' | 'ripple' | 'swirl' | 'sphere'
default:"'sphere'"
Shape pattern type:
  • simplex: Simplex noise pattern
  • warp: Warped flowing pattern
  • dots: Animated dot pattern
  • wave: Sine wave pattern
  • ripple: Circular ripple effect
  • swirl: Twisted vortex pattern
  • sphere: 3D illuminated sphere
'random' | '2x2' | '4x4' | '8x8'
default:"'4x4'"
Dithering algorithm type:
  • random: Random dithering
  • 2x2: 2×2 Bayer matrix
  • 4x4: 4×4 Bayer matrix
  • 8x8: 8×8 Bayer matrix (finest)
number
default:"2"
Pixel size of dithering grid. Higher values create larger pixels. Range: 0.5 to 20.
number
default:"1"
Animation speed multiplier. Set to 0 to pause animation.
number
default:"0"
Specific frame to display when speed is 0.

Common Sizing Parameters

number
default:"0.6"
Overall zoom level of the graphics. Range: 0.01 to 4.
number
default:"0"
Rotation angle in degrees. Range: 0 to 360.
'none' | 'contain' | 'cover'
default:"'contain'"
How to fit the shader into the canvas dimensions.
number
default:"0"
Horizontal offset of the graphics center. Range: -1 to 1.
number
default:"0"
Vertical offset of the graphics center. Range: -1 to 1.

Presets

The Dithering shader comes with several built-in presets:
  • Default: Blue sphere with 4×4 Bayer dithering
  • Warp: Green flowing pattern with 4×4 dithering
  • Sine Wave: Cyan wave with 4×4 dithering
  • Ripple: Orange circular ripples with 2×2 dithering
  • Bugs: Green animated dots with random dithering
  • Swirl: Blue vortex with 8×8 dithering

Notes

  • This shader performs sizing in the fragment shader to keep pixel grid consistent
  • Different dithering types create different visual textures:
    • random: Organic, grainy appearance
    • 2x2: Coarse, checkerboard-like pattern
    • 4x4: Medium detail, classic dithering look
    • 8x8: Fine detail, smooth gradations
  • Experiment with size parameter to achieve retro pixel art effects