29

GitHub - jpbruyere/vkvg: Vulkan vector drawing, try to stay close to cairo api...

 5 years ago
source link: https://github.com/jpbruyere/vkvg
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md


vkvg

Vulkan Vector Graphics

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667

What is vkvg?

vkvg is a multiplatform c library for drawing 2D vector graphics with Vulkan.

Cairo was missing a Vulkan backend, so I decided to start one myself trying to keep my api as close to Cairo as possible.

Current status:

vkvg is in early development stage, 0.1 beta release is on the road.

  • Fill (with stencil even-odd technic) and Stroke functional.
  • 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

screenshot1.png

Requirements:

  • Vulkan
  • FontConfig
  • Freetype
  • PkgConfig (currently used only to find harbfbuzz)
  • Harfbuzz
  • GLSLC: spirv compiler, included in LunarG SDK (building only)
  • xxd: generate headers with precompiled shaders (building only)
  • GLFW (only for running demo app)
  • CMake

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

Building

git clone https://github.com/jpbruyere/vkvg.git     # Download source code from github
cd vkvg                                             # Enter the source directory
git submodule update --init --recursive             # Dowload vkhelpers sources
mkdir build					    # Create build directory
cd build
cmake ..					    # Run CMake, optionaly setup glslc path
make						    # Run Make

Roadmap

  • Radial gradients.
  • Dashed lines.
  • Operators.
  • Improve stroke algorithms.
  • Offscreen pattern building.
  • 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.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK