VASE renderer version 0.42 (VASEr 0.42) is a tessellating library for rendering high quality vector graphics. It is an attempt to address unconventional features in 2d graphics. It is intended for OpenGL 1.1+, but much of the code is API independent C++.
Outset-fade polygon is the high quality, fast, portable, consistent and hassle free technique for anti aliasing. The difficulties are to calibrate the outsetting distance to achieve believable result and to perform tedious tessellation. Luckily VASEr did this for you.
Below are line rendering comparison between VASEr and Cairo, click flip to compare:
between VASEr and AGG:
There is small difference, but it is more a matter of taste than correctness. In terms of clarity VASEr is like between Cairo and AGG, and VASEr is the most crisp among the three. VASEr even do pixel alignment to 1px completely horizontal or vertical lines.
The flaw is, because the outsetting distance is resolution dependent, while the triangulation is unaffected under rotational transformation, fidelity will be lost under scale and sheer.
VASEr is for real time rendering. Tessellation is done on CPU and the triangles are then sent off to GPU for rasterization. VASEr is fast regardless of the rendering resolution.
Can tessellation be accelerated by GPU? Probably, but I have no plan to do so. The performance enhancement strategy of VASEr is adaptation, that means doing expensive joint processing only when necessary and unperceivablely switch to approximation for thin lines and curves. The decision requires some global information and result in lots of branching, which makes it harder to write GPU programs. But after all, correctness is the first priority and performance is the last.
Q: Who needs "Per vertex coloring and weighting", "Linear gradient along curve" or "Feathering for brush like effects" in vector graphics? A: Same answer as "who needs typesetting and beautiful fonts on their computers?".
Q: These effects can be achieved by vector graphics package XXX using tool AAA then effect BBB, so who needs VASE renderer? A: Arguably true. But the fundamental change is making vertex a three dimensional entity (position, color, weight), and to supercharge the intrinsic properties of strokes. The idea is, it should be natural to apply colors and thickness to a stroke.
VASEr is production ready for conventional use. The unconventional features are largely usable for normal circumstances, but may have defects at extreme cases. In particular, varying thickness is undesirable at acute angles and when weight difference is large. So it is not bullet proof yet. The tessellation code is tediously written for each point for each triangle for each circumstance, because a general outsetting and tessellating algorithm is doomed to be slow.
Currently VASEr is only a programming library and is not used in any vector graphics tool. I do have a plan (a plan only) to develop associated tools.
VASEr is not (yet) a general purpose graphics library like Cairo, its feature is still very limited. It has been developed slowly over the years. I always wanted to develop VASEr into a general purpose graphics library, but just do not have the time. It takes more effort than you may think to develop a rendering routine. Any comment, bug report or patch is greatly appreciated. In any case, sending me any form of encouragement (e.g. great work, thank you, donation) will help.
Package with documentation, source code, sample images and sample programs is on github. Comments, discussions, and contributions are greatly appreciated. You can reach me via email or on github.
VASE renderer version 0.42 (VASEr 0.42) is licensed under The 3-Clause BSD License.
Copyright (2011-2016) Tsang Hao Fung (Chris Tsang) firstname.lastname@example.org
Bezier curve subdivision code is extracted from Anti-Grain Geometry V2.4 Copyright 2002-2005 Maxim Shemanarev (McSeem) [Modified BSD License]comments powered by Disqus