Skip to content
🎉 Angular Three v4 is here! Read the announcement

NgtpASCII

The ASCII effect renders your scene as ASCII characters, creating a retro terminal-style appearance. Character brightness is mapped to different ASCII characters.

import { NgtpEffectComposer, NgtpASCII } from 'angular-three-postprocessing';
@Component({
template: `
<ngtp-effect-composer>
<ngtp-ascii [options]="{
fontSize: 54,
cellSize: 16,
color: '#00ff00'
}" />
</ngtp-effect-composer>
`,
imports: [NgtpEffectComposer, NgtpASCII],
})
export class SceneGraph {}
PropertyTypeDefaultDescription
fontstring'arial'Font family for ASCII characters
charactersstringCharacters used for brightness mapping
fontSizenumber54Font size in pixels
cellSizenumber16Size of each ASCII cell
colorstring'#ffffff'Color of ASCII characters
invertbooleanfalseInvert brightness mapping

Create a classic green terminal look:

@Component({
template: `
<ngt-mesh>
<ngt-torus-knot-geometry *args="[1, 0.3, 128, 32]" />
<ngt-mesh-standard-material color="white" />
</ngt-mesh>
<ngtp-effect-composer>
<ngtp-ascii [options]="{
fontSize: 48,
cellSize: 12,
color: '#00ff00',
characters: ' .:-=+*#%@'
}" />
</ngtp-effect-composer>
`,
imports: [NgtpEffectComposer, NgtpASCII, NgtArgs],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class SceneGraph {}
  • Smaller cellSize values create more detailed ASCII art but may impact performance
  • The characters string should be ordered from darkest to brightest
  • Use monospace fonts for consistent character spacing