GPU 字符画后处理
ASCII (THREE.js ASCII Effect on the GPU),Emil Widlund,2023 年

正在布展…
它是怎么做的
- 第 1 步把字符集按亮度顺序画到一张横向图集纹理
- 第 2 步后处理中把屏幕划成格子,每格取中心像素亮度
- 第 3 步按亮度选出字符在图集中的偏移,用格内局部 UV 采样
- 第 4 步可调字符集、格子大小、颜色、反相
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Draw your character ramp (e.g. ' .:-=+*#%@') into a single-row canvas atlas texture at a fixed font size. In a full-screen post-processing pass, quantise gl_FragCoord into cells of N pixels, sample the scene color at each cell's center and compute luminance. Map luminance to a character index, then sample the atlas at that character's slot using the pixel's local position within the cell. Multiply by a tint or the original color, and expose cell size and ramp as uniforms.
档案
交互
能不能拿来用
原作以 MIT (package.json; no LICENSE file) 许可开源:可以阅读源码学习,按许可证条款使用;在自己的项目里引用时保留原作者署名。
性能开销
视觉强度
实现难度
尺度为策展判断(1 到 5),用于比较和推荐。
核实记录:Repo exists with README and source; licence from package.json (MIT); no public live demo found.


