ASCII

Renders the scene as ASCII art, mapping pixel luminance to characters drawn onto a canvas-based character atlas. Adapted from emilwidlund/ASCII.

import { ASCII } from '@react-three/postprocessing'

return (
  <ASCII
    font="arial" // font family used to draw the character atlas
    characters=" .:,'-^=*+?!|0#X%WM@" // characters to sample from, in order of increasing "weight"
    fontSize={54} // font size used to draw the character atlas
    cellSize={16} // size of each character cell, in pixels
    color="#ffffff" // character color
    invert={false} // inverts which characters map to bright vs dark pixels
  />
)

Props

NameTypeDefaultDescription
fontString'arial'The font family used to draw the character atlas.
charactersString .:,'-^=*+?!|0#X%WM@The characters to sample from, ordered from "empty" to "dense".
fontSizeNumber54The font size used to draw the character atlas.
cellSizeNumber16The size of each character cell, in pixels.
colorString'#ffffff'The color of the characters.
invertBooleanfalseInverts which characters map to bright vs dark pixels.