在 OSX 上从 Metal 打印矢量图形
Printing vector graphics from Metal on OSX
是否可以从 Metal API 输出矢量图形?
特别是在渲染方面fonts/text。
使用有符号距离场的问题(如 Chris Green 2007 年的论文"Improved Alpha-Tested Magnification for Vector Textures and Special Effects") for this is that they require you to rasterize the glyphs at a finite resolution and reconstruct the glyph outline in a shader, which can lead to reduced fidelity. There have been some strong advances in this field lately, such as Viktor Chlumský's work on using multi-channel SDF textures 中所述,以保持清晰的边缘。
在过去的十年中,也有很多关于使用 GPU 更直接地渲染隐式曲线的工作,其中大部分源自 Loop & Blinn 的 "Resolution Independent Curve Rendering using Programmable Graphics Hardware" (2005),该论文也写在GPU Gems 3. The most robust implementation of glyph rendering that does GPU-only rasterization that I know of is the one in GLyphy. Will Dobbie has written an impressive WebGL demo that uploads glyph outline parameters as a texture and also rasterizes purely on the GPU, briefly described here.
另外,不提Matt Deslaurier's work in this area. You can view some of his demos here也是我的失职。
总而言之,我的 post/book(在 Marius 的回答中提到)展示了在 Metal 中 SDF 字体渲染的基本实现,但是上面列出的任何技术都应该在 Metal 中相当简单地实现,一旦你理解思路,多半会出更好的效果。
是否可以从 Metal API 输出矢量图形?
特别是在渲染方面fonts/text。
使用有符号距离场的问题(如 Chris Green 2007 年的论文"Improved Alpha-Tested Magnification for Vector Textures and Special Effects") for this is that they require you to rasterize the glyphs at a finite resolution and reconstruct the glyph outline in a shader, which can lead to reduced fidelity. There have been some strong advances in this field lately, such as Viktor Chlumský's work on using multi-channel SDF textures 中所述,以保持清晰的边缘。
在过去的十年中,也有很多关于使用 GPU 更直接地渲染隐式曲线的工作,其中大部分源自 Loop & Blinn 的 "Resolution Independent Curve Rendering using Programmable Graphics Hardware" (2005),该论文也写在GPU Gems 3. The most robust implementation of glyph rendering that does GPU-only rasterization that I know of is the one in GLyphy. Will Dobbie has written an impressive WebGL demo that uploads glyph outline parameters as a texture and also rasterizes purely on the GPU, briefly described here.
另外,不提Matt Deslaurier's work in this area. You can view some of his demos here也是我的失职。
总而言之,我的 post/book(在 Marius 的回答中提到)展示了在 Metal 中 SDF 字体渲染的基本实现,但是上面列出的任何技术都应该在 Metal 中相当简单地实现,一旦你理解思路,多半会出更好的效果。