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 patternwarp: Warped flowing patterndots: Animated dot patternwave: Sine wave patternripple: Circular ripple effectswirl: Twisted vortex patternsphere: 3D illuminated sphere
'random' | '2x2' | '4x4' | '8x8'
default:"'4x4'"
Dithering algorithm type:
random: Random dithering2x2: 2×2 Bayer matrix4x4: 4×4 Bayer matrix8x8: 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 appearance2x2: Coarse, checkerboard-like pattern4x4: Medium detail, classic dithering look8x8: Fine detail, smooth gradations
- Experiment with
sizeparameter to achieve retro pixel art effects
