Skip to content

Latest commit

ย 

History

History
73 lines (52 loc) ยท 3.03 KB

File metadata and controls

73 lines (52 loc) ยท 3.03 KB

Pathfinder C++

License C++ Standard

A high-performance, GPU-accelerated 2D vector graphics library, ported from the original Rust implementation of Pathfinder 3. This version brings the power of massivly parallel vector rasterization to the C++ ecosystem, with native Vulkan, OpenGL, and Metal backends.

๐Ÿš€ Key Features

  • Massively Parallel Rasterization: Leverages the GPU to rasterize complex vector scenes at high speeds.
  • Dual Rendering Strategies:
    • Hybrid Mode: CPU-assisted binning with hardware rasterization. Optimized for mobile devices and static path caching.
    • GPU-Driven Mode: Full compute-shader-based pipeline. Minimizes CPU overhead by moving binning and tiling entirely to the GPU.
  • Advanced Effects: Native support for shadows, blurs, gradients, and complex clipping paths.
  • Cross-Platform: Designed for Windows, Linux, macOS, Android, and Web (Wasm).

๐Ÿ›  Supported Backends

Backend Hybrid Mode GPU-Driven Mode Notes
Vulkan โœ… โœ… Best performance
Metal โœ… โœ… Not MoltenVK
OpenGL 4.3+ โœ… โœ… Desktop standard
OpenGL ES 3.1+ โœ… โœ…* *Limited by Storage Image access on some ES devices
OpenGL ES 3.0 โœ… โŒ Compatibility mode
WebGL2 โœ… โŒ Web target

๐Ÿ“ฆ Getting Started

Prerequisites

  • C++14 compatible compiler.
  • CMake 3.15+.
  • Vulkan SDK (if building with Vulkan support or regenerating shaders).

Building the Library

git clone --recursive https://github.com/your-repo/pathfinder-cpp.git
cd pathfinder-cpp
mkdir build && cd build
cmake ..
make

๐ŸŽฎ Demos

Windows / Linux / macOS

The native demo uses a common application framework.

  1. Initialize submodules: git submodule update --init --recursive.
  2. Open the project in your favorite IDE (CLion, VS) and run the demo target.

Android

  1. Copy assets into demo/android/app/src/main.
  2. Open demo/android in Android Studio.
  3. Deploy to a device supporting GLES 3.0+.

Web (Emscripten)

  1. Set up the Emscripten environment.
  2. Run ./build_wasm.sh.
  3. Run ./demo/web/serve.sh and visit http://127.0.0.1:8000.

๐Ÿ“œ Acknowledgments

This project is a port of the Pathfinder engine developed by the Servo project.