ASCII / character-cell rendering
Divides the frame into character cells and replaces each with the glyph whose shape best matches the average brightness (and optionally edge direction) of that cell.
In the family Stylized & non-photorealistic rendering, glyph mapping
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { AsciiEffect } from 'three/addons/effects/AsciiEffect.js' docs |
| Babylon.js 9.38.0 | Official add-on | new BABYLON.AsciiArtPostProcess('a', camera, {font:'40px Monospace'}) from @babylonjs/post-processes docs |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | No built-in ASCII character-cell post-process effect. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
The scene is rendered, then downsampled so each pixel represents one character cell. For each cell, a luminance value picks a glyph from a ramp ordered by ink coverage, for instance a space, a dot, a colon, and a hash. A font atlas texture stores the glyph images, and the final shader samples the atlas using the glyph index and the within-cell coordinates. Better variants compare the cell's shape with each glyph's shape vector and pick the best match, or use edge orientation from a Sobel pass to choose /, |, \, - for contours. Colour can tint the glyph with the cell average.
When to choose it
Reach for it when
- want my 3d scene drawn with text characters
- need a terminal or hacker style look
- turn frame brightness into letters and symbols
- retro console aesthetic made of glyph cells
Choose it for terminal, hacker or retro aesthetics. Prefer Halftone screens or Ordered dithering with Bayer matrices when you want a fine pattern rather than readable glyphs, and Pixel-art 3D rendering for blocky pixel look.
Field marks
- Flicker in cells whose brightness hovers near a glyph threshold
- Low resolution loses small features entirely
- Glyph shape ignored by a brightness-only ramp gives soft, mushy structure
- Temporal instability when camera motion shifts content across cell boundaries
Presets
Left: source image. Right: 8px character cells, glyph density chosen from cell brightness
{
"CELL": 8
}Show GLSL (38 lines)
float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}
float lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}
vec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}
vec3 img(vec2 p){
vec3 c=mix(vec3(.12,.18,.34),vec3(.95,.72,.45),clamp(p.y+.5,0.,1.));
vec2 q=p-vec2(-.03,.14); float rr=.16; float d=length(q)-rr;
vec3 n=normalize(vec3(q/rr,sqrt(max(1.-dot(q,q)/(rr*rr),0.))));
float l=clamp(dot(n,normalize(vec3(-.5,.6,.6))),0.,1.);
c=mix(c,vec3(.85,.26,.2)*(.18+.9*l),smoothstep(.002,-.002,d));
vec2 r=p-vec2(0.,-.2);
if(abs(r.x)<.2&&abs(r.y)<.09) c=mix(vec3(.1,.35,.3),vec3(.93,.92,.85),smoothstep(-.3,.3,sin(r.x*340.+r.y*90.)));
if(p.y<-.34&&p.y>-.42){ vec3 h=.5+.5*cos(6.2832*((p.x+.25)*2.+vec3(0.,.33,.67))); c=h; }
c=mix(c,vec3(.97,.85,.2),smoothstep(.003,-.003,abs(p.x-.17)-.025)*step(.0,p.y)*step(p.y,.4));
return c;
}
const float CELL=8.0; // P
float glyph(vec2 g,int lv){
if(lv==1)return step(length(g-vec2(0.,-.55)),.22);
if(lv==2)return max(step(length(g-vec2(0.,-.55)),.22),step(length(g-vec2(0.,.15)),.22));
if(lv==3)return step(abs(g.y),.16)*step(abs(g.x),.6);
if(lv==4)return max(step(abs(g.y),.14)*step(abs(g.x),.7),step(abs(g.x),.14)*step(abs(g.y),.7));
if(lv==5)return max(step(abs(abs(g.x)-.4),.14)*step(abs(g.y),.85),step(abs(abs(g.y)-.35),.14)*step(abs(g.x),.85));
if(lv>=6)return step(abs(g.x),.8)*step(abs(g.y),.85)*(1.-.6*step(length(g),.35));
return 0.;}
void mainImage(out vec4 fragColor,in vec2 fragCoord){
vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);
vec3 col;
if(!R) col=img(q);
else{
vec2 cc=(floor(fragCoord/CELL)+.5)*CELL,cu=(cc-.5*iResolution.xy)/iResolution.y;
float L=lum(img(vec2(cu.x-.25,cu.y)));
int lv=int(clamp(floor(L*7.),0.,6.));
vec2 g=(fract(fragCoord/CELL)-.5)*2.;
col=vec3(.04,.06,.05)+vec3(.45,1.,.6)*glyph(g,lv)*(.55+.45*L);
}
if(abs(uv.x)<.0015)col=vec3(1.);fragColor=vec4(clamp(col,0.,1.),1.);
}Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| ascii-rendering-specimen | Tesla T4 1920x1080 | 1.84× baseline (feather) · 0.061 ms / 0.064 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| ascii-rendering-specimen | NVIDIA L4 1920x1080 | 1.28× baseline (feather) · 0.020 ms / 0.021 ms · 3.0× faster on L4 | opengl-timer-query · Cross-architecture validation |
| ascii-rendering-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 1.24× baseline (feather) · 0.036 ms / 0.036 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Crosses
- Depth/normal Sobel edge outlines: Edge directions choose line-drawing glyphs along contours.