Features
- Multiple dot styles (classic, gooey, holes, soft)
- Two grid types (square, hex)
- Original color preservation or custom colors
- Adjustable dot size and contrast
- Grain effects and overlays
- Inverted luminance option
Basic Usage
Parameters
Visual Parameters
Optional source image to apply the halftone effect to
Dot style:
classic: Sharp circular dotsgooey: Soft blended dots that merge togetherholes: Inverted dots creating holessoft: Smooth gradient dots
Grid arrangement:
square: Square/rectangular gridhex: Hexagonal grid (more organic)
Grid size relative to the image box (0 = large dots, 1 = small dots)
Maximum dot size relative to grid cell
Contrast applied to the sampled image before halftoning
Foreground/dot color in hex, rgb, or rgba format
Background color in hex, rgb, or rgba format
Use sampled image’s original colors instead of colorFront
Inverts the image luminance (doesn’t affect the color scheme)
Strength of grain distortion applied to dot edges
Post-processing black/white grain overlay
Scale applied to both grain distortion and grain overlay
Sizing Parameters
How to fit the shader into the canvas dimensions
Overall zoom level of the graphics
Overall rotation angle in degrees
Horizontal offset of the graphics center
Vertical offset of the graphics center
Animation Parameters
Animation speed multiplier (0 for static)
Manual frame control for animation
Presets
The HalftoneDots shader comes with several built-in presets:- Default: Gooey dots on hex grid with grain
- LED Screen: Soft dots on square grid simulating LED display
- Mosaic: Classic dots with original colors
- Round and Square: Hole dots with inverted luminance
Examples
LED Screen Effect
Mosaic Pattern
Inverted Holes
Classic Print
Technical Details
Shader Uniforms (Vanilla JS)
When using the vanilla JavaScript API:Dot Types
classic(0): Sharp circular dots with antialiasinggooey(1): Soft dots that blend togetherholes(2): Inverted effect creating holessoft(3): Smooth gradient dots
Grid Types
square(0): Rectangular grid alignmenthex(1): Hexagonal grid (offset rows)
Color Modes
Custom Color Mode (originalColors: false):
- Uses
colorFrontfor dots andcolorBackfor background - Creates monochrome or duotone effect
- Best for stylized looks
originalColors: true):
- Preserves image colors in halftone pattern
- Adjusts
radiusandcontrastautomatically - Best for realistic halftone prints
Performance Notes
- Static shader (no animation by default)
- Performance depends on
size(smaller = slower) gooeyandsofttypes sample multiple cells- Grain effects have minimal performance impact
- Works best with moderate
sizevalues (0.3-0.7)
