通过覆盖抗锯齿化合物? [英] Antialiased composition by coverage?

查看:128
本文介绍了通过覆盖抗锯齿化合物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道图形系统可以很好地处理多条抗锯齿线的组合?

我展示了一个依赖关系图,并且从一个点出现了一堆曲线。这些通常以混合部分覆盖的像素的方式绘制为消除锯齿。因此,如果两条线占据像素的相同一半,则抗锯齿​​混合将其填充到75%而不是50%填充。如果有足够多的线条在彼此的顶部绘制,那么像素混合将会夹住,最后会出现锯齿线。



我知道反粒面几何有计算混合的算法,对于紧靠的线条,并且过采样可能会奏效,但是还有其他方法吗?解析方案

处理这种形式的线条组合会变得很慢(你必须考虑使用延迟渲染方法影响每个像素的所有线)。我怀疑有很多(如果有的话)的图书馆会为你做这件事。



最快最简单的方法(也可能是唯一的现实和成本效益的解决方案对于你的情况),它几乎可以与任何绘图库一起工作,就可以对其进行超级采样 - 以更高的分辨率绘制离屏位图(例如,宽度和宽度分别为4倍和4倍像素的宽度)。只会减慢速度),然后用双线性过滤缩小结果。主要缺点是它为离屏位图使用了大量内存。


Does anyone know of a graphics system which handles composition of multiple anti-aliased lines well?

I'm showing a dependency diagram and have a bunch of curves emanating from a point. These are drawn anti-aliased in the usual way, of blending partially covered pixels. So if two lines would occupy the same half of a pixel, the antialiasing blends it to 75% filled rather than 50% filled. With enough lines drawn on top of each other, the pixel blend clamps and you end up with aliased lines.

I know anti-grain geometry has algorithms for calculating blends which cater for lines which abut, and that oversampling might work, but are there any other approaches?

解决方案

Handling this form of line composition well is going to be slow (you have to consider all the lines that impinge upon each pixel using a deferred rendering approach). I doubt that there are many (if any) libraries out there that will do it for you.

The quickest and easiest method (and possibly the only realistic and cost effective solution for your case), which will work with virtually any drawing library would be to supersample it - draw to an offscreen bitmap at much higher resolution (e.g. 4 times wider and higher, with lines of 4 pixels width. Disable antialiasing when drawing this as it'll only slow it down) and then scale the result down with bilinear filtering. The main down-side is that it uses a lot of memory for the offscreen bitmap.

这篇关于通过覆盖抗锯齿化合物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆