图形学与人机交互2025github.com
用稀疏条带在 CPU 上实现高性能 2D 图形渲染(硕士论文)
High-performance 2D graphics rendering on the CPU using sparse strips
专业 · 约 90 分钟读完前置知识:2D 光栅化基础、贝塞尔曲线与路径填充、CPU 性能优化
导读
这篇硕士论文研究如何在 CPU 上实现高性能的 2D 图形渲染,核心思路是用“稀疏条带(sparse strips)”结构来表示和光栅化路径,以降低内存占用并提升渲染速度。论文由 Vello 相关开发者完成,展示了 CPU 渲染器在性能上可以接近 GPU 方案。
HN 关注点:CPU 与 GPU 2D 渲染的取舍:在 WebGPU 逐渐成为主流的背景下,一个高性能 CPU 渲染器在可移植性、二进制体积和 shader 编译开销方面仍有独特价值。
HN 评论精选
这几条评论里:质疑 1 补充 3
补充认为 WebGPU 正成为 2D 渲染主流,但 CPU 渲染器在 Web 场景(shader 编译开销、二进制体积)仍有价值,可考虑混合分阶段方案
很有意思的项目。根据 3.9 节,输出似乎是位图形式,那最终显示时应该需要把整块内存拷贝到 GPU。随着 Skia 迁移到 WebGPU(且 WebGPU 支持计算着色器),2D 图形在可移植性和性能上正逐渐成为“已解决的问题”。当然也有适合 CPU 渲染器的场景,有趣的是 Web 恰好是其中之一,因为页面加载时需要运行时编译 shader。我在想是否可以像 JS JIT 那样分阶段:先用 CPU 渲染器,同时等 GPU 编译好 shader。另一个好处是二进制体积——WebGPU(至少 via dawn)相当大。
fngjdflmdflg查看英文原文
Fascinating project. Based on section 3.9, it seems the output is in the form of a bitmap. So I assume you have to do a full memory copy to the GPU to display the image in the end. With skia moving to WebGPU[0] and with WebGPU supporting compute shaders, I feel that 2D graphics is slowly becoming a solved problem in terms of portability and performance. Of course there are cases where you would a want a CPU renderer. Interestingly the web is sort of one of them because you have to compile shaders at runtime on page load. I wonder if it could make sense in theory to have multiple stages to this, sort of like how JS JITs work, were you would start with a CPU renderer while the GPU compiles its shaders. Another benefit, as the author mentions, is binary size. WebGPU (via dawn at least) is rather large. [0] https://blog.chromium.org/2025/07/introducing-skia-graphite-chromes.html
质疑指出论文中条带内存占用的计算疑似有误(64 字节 vs 8 字节),导致存储估算可能差 3 倍
论文定义了这个结构:struct Strip { x: u16, y: u16, alpha_idx_fill_gap: u32 },看起来是 64 位(8 字节)大小。但论文接着说“由于单个条带占用 64 字节内存,单个 alpha 值以 u8 存储,所需存储约为 259 * 64 + 7296 ≈ 24KB”。是我漏了什么,还是实际上应该是 259*8 + 7296 ≈ 9KB?
voidmain查看英文原文
The paper defines this structure struct Strip { x: u16, y: u16, alpha_idx_fill_gap: u32, } which looks like it is 64 bits (8 bytes) in size, and then says > Since a single strip has a memory footprint of 64 bytes and a single alpha value is stored as u8, the necessary storage amounts to around 259 ∗ 64 + 7296 ≈ 24KB am I missing something, or is it actually 259*8 + 7296 ≈ 9KB?
补充补充推荐另一个 CPU 并行光栅化项目 blaze
另外可以看看 blaze:https://gasiulis.name/parallel-rasterization-on-cpu/
miguel_martin查看英文原文
Also checkout blaze: https://gasiulis.name/parallel-rasterization-on-cpu/
补充询问是否存在验证渲染器正确性的标准测试集
顺便问一下,有没有某种基准测试可以检验渲染器的正确性?
amelius查看英文原文
Side question. Is there some kind of benchmark to test the correctness of renderers?
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2025Hacker News 讨论帖281 分 · 35 评
同领域还值得读
像素不是小方块 (1995)
A Pixel Is Not A Little Square (1995)
这篇 1995 年的经典备忘录讨论数字图像中像素应如何理解:像素不是有面积的小方块,而是对连续图像的采样点,重建连续图像需要合适的重建滤波器。
图形学与人机交互2014 · 372 分 · 241 评进阶 · 约 20 分钟编辑精选自动化的讽刺(Ironies of Automation,1983)
Ironies of Automation (1983)
这篇 1983 年的经典论文讨论自动化(尤其过程控制)中的悖论:自动化越先进,人类操作员在异常处理和人工接管中的作用可能越关键;自动化常把常规任务拿走,留下监控、诊断和罕见故障处…
图形学与人机交互2019 · 147 分 · 38 评入门 · 约 30 分钟编辑精选GDPR 同意框中的暗黑模式
Dark patterns in GDPR consent boxes
研究 GDPR 同意框中的暗黑模式,即网站如何通过界面设计引导用户同意 Cookie 与追踪。
图形学与人机交互2020 · 328 分 · 122 评 · 引用 6进阶 · 约 30 分钟GDPR 后的暗模式:同意弹窗及其影响
Dark patterns after the GDPR: consent pop-ups and their influence
研究 GDPR 生效后网站 consent pop-ups 中的 dark patterns,以及这些弹窗如何影响用户的同意选择。
图形学与人机交互2021 · 251 分 · 228 评进阶 · 约 60 分钟光线追踪一个微型程序化星球
Ray Tracing a Tiny Procedural Planet
研究如何对一个微小的程序化星球进行光线追踪渲染,属于计算机图形学中程序化生成与渲染的示例。
图形学与人机交互2019 · 247 分 · 9 评进阶 · 约 60 分钟