Halftone

An RGB halftone print effect: each color channel becomes a rotated grid of dots whose size follows the image brightness, for a comic or printed look.

Ported from the three.js HalftonePass.

import { Halftone, HalftoneShape } from '@react-three/postprocessing'
import { BlendFunction } from 'postprocessing'

return (
  <Halftone
    shape={HalftoneShape.Dot} // Dot, Ellipse, Line or Square
    radius={4} // dot grid spacing in pixels
    rotateR={Math.PI / 12} // red channel grid rotation
    rotateG={(Math.PI / 12) * 2} // green channel grid rotation
    rotateB={(Math.PI / 12) * 3} // blue channel grid rotation
    scatter={0} // random dot offset, 0 to 1
    greyscale={false} // renders the dots in greyscale
    blendFunction={BlendFunction.NORMAL} // blend mode
  />
)

Props

NameTypeDefaultDescription
shapeHalftoneShapeHalftoneShape.DotThe dot shape: Dot, Ellipse, Line or Square.
radiusNumber4Dot grid spacing and maximum dot radius in pixels.
rotateRNumberMath.PI / 12Rotation of the red channel grid in radians.
rotateGNumberMath.PI / 6Rotation of the green channel grid in radians.
rotateBNumberMath.PI / 4Rotation of the blue channel grid in radians.
scatterNumber0Random dot offset, 0 to 1.
greyscaleBooleanfalseRenders the dots in greyscale.
blendFunctionBlendFunctionBlendFunction.NORMALThe blend function of this effect.
opacityNumber1The opacity of this effect.