Skip to content

tyt2y3/vaserenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project was started many, many years ago. The C++ implementation is a pre-OpenGL 3 relic. The C# implementation is more "modern" and uses fragment shader, which is better.

VASE renderer

About

VASE renderer version 0.42 (VASEr 0.42) is a tessellating library for rendering high quality 2D 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++.

Unconventional features

Per vertex coloring and weighting



VASEr revolutionarily lets you control the color and thickness at each vertex for a polyline. This feature is unseen on any commonly available graphics library.

Linear gradient along curve


A similar feature is also available to curves. Because there are so many vertices on a curve that it is impractical to specify data on each point, VASEr lets you define a linear gradient of color and thickness along the length of a curve, giving you two more degrees of freedom.

Feathering for brush like effects


VASEr must use an outsetting polygon anyway, so it is free (as in computational cost) to scale it up, and it is called feathering in VASEr.

Premium quality anti aliasing



From left to right: raw polygon without anti aliasing,
anti aliased with outset fade polygon,
exaggerated outsetting polygon with wireframe,
same as left without wireframe.

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 and AGG:

VASEr
Cairo
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.

Articles

Related Work

  • If you only need uniform color & width and only wanted a clean mesh, you can try out Polyline2D.

Acknowledgement

Bezier curve subdivision code is extracted from Anti-Grain Geometry V2.4 by Maxim Shemanarev (McSeem).

The open-source graphics library AGG inspired me a lot during my teenage.

About

VASE renderer is a polyline and curve renderer on OpenGL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published