/vkvg

Vulkan 2D graphics library

Primary LanguageCMIT LicenseMIT


vkvg

Vulkan Vector Graphics

vkvg is an open source 2D graphics library written in c using Vulkan as backend. It's api follows the same pattern as Cairo, but new functions and original drawing mechanics may be added.

vkvg is in early development stage, api may change, any contribution is welcome.

For API documentation and usage, please refer to the Cairo documentation for now.

Performance comparison


major libs perf comparison

Current status:

  • Fill (stencil even-odd, non-zero with ear clipping).
  • Stroke.
  • Basic painting operation.
  • Font system with caching operational.
  • Linear Gradients.
  • Line caps and joins.
  • Context should be thread safe, extensive tests required.
  • Image loading and writing with stb lib
  • Test includes svg rendering with nanoSVG

Requirements:

if glslc or xxd are not present, a precompiled version of the shaders is stored in the git tree.

Building

#fetch sources from github
git clone --recursive https://github.com/jpbruyere/vkvg.git
cd vkvg
# Create build directory
mkdir build
cd build
# Run CMake, optionaly setup glslc path
cmake ..
make

A detailed tutorial is available for Windows.

Running tests

Append the -h option to see available command line parameters.

Contributing

See the contribution guide for more information.

Join us on gitter for any question.

To Do

  • Use Scissor where possible.
  • Improve stroke algorithms.
  • Radial gradients.
  • Dashed lines.
  • Operators.
  • Optimize vulkan memory allocations by sub-allocating from a single shared memory chunk per type.
  • Optimize command submissions.
  • Test SDF font rendering.
  • Avoid line joins inside curves and arc.
  • Structured unit testing.
  • Perf and memory checks.
  • Code clean and comment.
  • Documentations.