vaserenderer

所属分类:OpenGL
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2020-03-03 17:06:35
上 传 者sh-1993
说明:  VASE渲染器是OpenGL上的多段线和曲线渲染器。,
(VASE renderer is a polyline and curve renderer on OpenGL.,)

文件列表:
LICENSE (1520, 2023-11-05)
cpp/ (0, 2023-11-05)
cpp/samples/ (0, 2023-11-05)
cpp/samples/Makefile (728, 2023-11-05)
cpp/samples/png_readwrite.cpp (4327, 2023-11-05)
cpp/samples/polyline (662750, 2023-11-05)
cpp/samples/polyline.cpp (10781, 2023-11-05)
cpp/samples/polyline.exe (1753550, 2023-11-05)
cpp/samples/samples (625619, 2023-11-05)
cpp/samples/samples.cpp (4500, 2023-11-05)
cpp/samples/samples.exe (1138312, 2023-11-05)
cpp/samples/segment (642997, 2023-11-05)
cpp/samples/segment.cpp (5301, 2023-11-05)
cpp/samples/segment.exe (1165087, 2023-11-05)
cpp/samples/test1_base.cpp (2222, 2023-11-05)
cpp/samples/vaser-bezier.png (35498, 2023-11-05)
cpp/samples/vaser-polyline.png (31182, 2023-11-05)
cpp/samples/vaser-segments.png (95421, 2023-11-05)
cpp/vaser/ (0, 2023-11-05)
cpp/vaser/agg_curve4.cpp (9217, 2023-11-05)
cpp/vaser/backend.h (191, 2023-11-05)
cpp/vaser/color.h (2784, 2023-11-05)
cpp/vaser/curve.cpp (3426, 2023-11-05)
cpp/vaser/gradient.cpp (2332, 2023-11-05)
cpp/vaser/opengl.cpp (2546, 2023-11-05)
cpp/vaser/point.h (5637, 2023-11-05)
cpp/vaser/polyline.cpp (53207, 2023-11-05)
cpp/vaser/vaser.cpp (687, 2023-11-05)
cpp/vaser/vaser.h (3118, 2023-11-05)
cpp/vaser/vertex_array_holder.h (4825, 2023-11-05)
cpp/workbench/ (0, 2023-11-05)
cpp/workbench/base.html (1079, 2023-11-05)
cpp/workbench/dragger.js (2071, 2023-11-05)
cpp/workbench/drawer.js (1271, 2023-11-05)
cpp/workbench/gradient_along_path.html (2881, 2023-11-05)
cpp/workbench/knife_cut_test (626590, 2023-11-05)
cpp/workbench/knife_cut_test.cpp (3928, 2023-11-05)
... ...

> 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

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

+ Drawing polylines by tessellation.
+ Drawing nearly perfect 2D line segments in OpenGL

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.


近期下载者

相关文件


收藏者