Halftone screens
Replaces continuous tone with a regular grid of dots whose size encodes brightness, imitating newspaper, comic and screen-print reproduction.
In the family Stylized & non-photorealistic rendering, print-style shading
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { HalftonePass } from 'three/addons/postprocessing/HalftonePass.js' docs |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | No built-in halftone screen post-process; requires a custom post-process material. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
The image is sampled on a rotated grid: each cell's centre samples the source brightness, and the fragment is filled if its distance to the cell centre is below a radius derived from that brightness. Using sqrt(1 - tone) for the radius keeps covered area roughly proportional to darkness. For colour, separate channels (CMYK or RGB) are screened at different angles, typically 15°, 75°, 0° and 45°, so the dot rosettes interlock instead of producing strong moire. The edge of the dot is smoothed with fwidth. Sampling the tone at cell centres rather than per pixel avoids dot shapes dissolving into noise.
When to choose it
Reach for it when
- want a newspaper or comic dot print look
- render should look screen-printed
- pop-art effect with dots sized by brightness
- convert smooth shading into printed dots
Choose it for a comic, pop-art or print look from a rendered frame. Prefer Ordered dithering with Bayer matrices or Blue-noise dithering when you need a pixel-level pattern for 1-bit output, and Procedural cross-hatching shader for line-based shading.
Field marks
- Dot grid moires with the screen pixel grid or with texture detail at certain scales
- Dot grid is fixed in screen space and slides over moving objects
- Small dots in dark regions alias without derivative-based smoothing
- Colour screens with wrong angles produce distracting rosette or moire patterns
Presets
Left: greyscale. Right: 45-degree dot screen, dot radius set by cell brightness
{
"CELLP": 9
}Show GLSL (30 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 CELLP=9.0; // P
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=vec3(lum(img(q)));
if(R){
float c=.70710678;mat2 M=mat2(c,-c,c,c); // rotate 45 deg
vec2 gp=M*fragCoord/CELLP,id=floor(gp)+.5;
vec2 cs=transpose(M)*(id*CELLP),cu=(cs-.5*iResolution.xy)/iResolution.y;
float L=lum(img(vec2(cu.x-.25,cu.y)));
float rad=sqrt(clamp(1.-L,0.,1.))*.72,d=length(fract(gp)-.5);
col=mix(vec3(.96,.94,.88),vec3(.08,.1,.2),smoothstep(rad+.04,rad-.04,d));
}
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 |
|---|---|---|---|
| halftone-screen-specimen | Tesla T4 1920x1080 | 2.67× baseline (light) · 0.088 ms / 0.089 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| halftone-screen-specimen | NVIDIA L4 1920x1080 | 1.87× baseline (feather) · 0.030 ms / 0.030 ms · 3.0× faster on L4 | opengl-timer-query · Cross-architecture validation |
| halftone-screen-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 1.72× baseline (feather) · 0.049 ms / 0.050 ms · 1.8× faster on A100 | opengl-timer-query · Cross-architecture validation |
Sources
- implementationdaniel-ilett (2022). daniel-ilett/shaders-halftone. A halftone shader created with Shader Graph for use in the Universal Render PipelineGitHub API · license MIT · 2026-11-29