|
3 | 3 | [](LICENSE) |
4 | 4 | [](https://en.wikipedia.org/wiki/C%2B%2B14) |
5 | 5 |
|
6 | | -A high-performance, GPU-accelerated 2D vector graphics library, ported from the original Rust implementation of [Pathfinder 3](https://github.com/servo/pathfinder). This version brings the power of massivly parallel vector rasterization to the C++ ecosystem, with native **Vulkan**, **OpenGL**, and **Metal** backends. |
| 6 | +A high-performance, GPU-accelerated 2D vector graphics library, ported from the original Rust implementation |
| 7 | +of [Pathfinder 3](https://github.com/servo/pathfinder). This version brings the power of massivly parallel vector |
| 8 | +rasterization to the C++ ecosystem, with native **Vulkan**, **OpenGL**, and **Metal** backends. |
7 | 9 |
|
8 | 10 | ## 🚀 Key Features |
9 | 11 |
|
10 | | -* **Massively Parallel Rasterization**: Leverages the GPU to rasterize complex vector scenes at high speeds. |
11 | | -* **Dual Rendering Strategies**: |
12 | | - * **Hybrid Mode**: CPU-assisted binning with hardware rasterization. Optimized for mobile devices and static path caching. |
13 | | - * **GPU-Driven Mode**: Full compute-shader-based pipeline. Minimizes CPU overhead by moving binning and tiling entirely to the GPU. |
14 | | -* **Advanced Effects**: Native support for shadows, blurs, gradients, and complex clipping paths. |
15 | | -* **Cross-Platform**: Designed for Windows, Linux, macOS, Android, and Web (Wasm). |
| 12 | +* **Massively Parallel Rasterization**: Leverages the GPU to rasterize complex vector scenes at high speeds. |
| 13 | +* **Dual Rendering Strategies**: |
| 14 | + * **Hybrid Mode**: CPU-assisted binning with hardware rasterization. Optimized for mobile devices and static path |
| 15 | + caching. |
| 16 | + * **GPU-Driven Mode**: Full compute-shader-based pipeline. Minimizes CPU overhead by moving binning and tiling |
| 17 | + entirely to the GPU. |
| 18 | +* **Advanced Effects**: Native support for shadows, blurs, gradients, and complex clipping paths. |
| 19 | +* **Cross-Platform**: Designed for Windows, Linux, macOS, Android, and Web (Wasm). |
16 | 20 |
|
17 | 21 | ## 🛠 Supported Backends |
18 | 22 |
|
19 | | -| Backend | Hybrid Mode | GPU-Driven Mode | Notes | |
20 | | -| :--- | :---: | :---: | :--- | |
21 | | -| **Vulkan** | ✅ | ✅ | Best performance | |
22 | | -| **OpenGL 4.3+** | ✅ | ✅ | Desktop standard | |
23 | | -| **OpenGL ES 3.1+** | ✅ | ✅* | *Limited by Storage Image access on some ES devices | |
24 | | -| **OpenGL ES 3.0** | ✅ | ❌ | Compatibility mode | |
25 | | -| **WebGL2** | ✅ | ❌ | Web target | |
| 23 | +| Backend | Hybrid Mode | GPU-Driven Mode | Notes | |
| 24 | +|:-------------------|:-----------:|:---------------:|:----------------------------------------------------| |
| 25 | +| **Vulkan** | ✅ | ✅ | Best performance | |
| 26 | +| **Metal** | ✅ | ✅ | Not MoltenVK | |
| 27 | +| **OpenGL 4.3+** | ✅ | ✅ | Desktop standard | |
| 28 | +| **OpenGL ES 3.1+** | ✅ | ✅* | *Limited by Storage Image access on some ES devices | |
| 29 | +| **OpenGL ES 3.0** | ✅ | ❌ | Compatibility mode | |
| 30 | +| **WebGL2** | ✅ | ❌ | Web target | |
26 | 31 |
|
27 | 32 | ## 📦 Getting Started |
28 | 33 |
|
29 | 34 | ### Prerequisites |
30 | | -* C++14 compatible compiler. |
31 | | -* CMake 3.15+. |
32 | | -* Vulkan SDK (if building with Vulkan support or regenerating shaders). |
| 35 | + |
| 36 | +* C++14 compatible compiler. |
| 37 | +* CMake 3.15+. |
| 38 | +* Vulkan SDK (if building with Vulkan support or regenerating shaders). |
33 | 39 |
|
34 | 40 | ### Building the Library |
| 41 | + |
35 | 42 | ```bash |
36 | 43 | git clone --recursive https://github.com/your-repo/pathfinder-cpp.git |
37 | 44 | cd pathfinder-cpp |
|
43 | 50 | ## 🎮 Demos |
44 | 51 |
|
45 | 52 | ### Windows / Linux / macOS |
| 53 | + |
46 | 54 | The native demo uses a common application framework. |
47 | | -1. Initialize submodules: `git submodule update --init --recursive`. |
48 | | -2. Open the project in your favorite IDE (CLion, VS) and run the `demo` target. |
| 55 | + |
| 56 | +1. Initialize submodules: `git submodule update --init --recursive`. |
| 57 | +2. Open the project in your favorite IDE (CLion, VS) and run the `demo` target. |
49 | 58 |
|
50 | 59 | ### Android |
51 | | -1. Copy `assets` into `demo/android/app/src/main`. |
52 | | -2. Open `demo/android` in Android Studio. |
53 | | -3. Deploy to a device supporting GLES 3.0+. |
| 60 | + |
| 61 | +1. Copy `assets` into `demo/android/app/src/main`. |
| 62 | +2. Open `demo/android` in Android Studio. |
| 63 | +3. Deploy to a device supporting GLES 3.0+. |
54 | 64 |
|
55 | 65 | ### Web (Emscripten) |
56 | | -1. Set up the Emscripten environment. |
57 | | -2. Run `./build_wasm.sh`. |
58 | | -3. Run `./demo/web/serve.sh` and visit `http://127.0.0.1:8000`. |
| 66 | + |
| 67 | +1. Set up the Emscripten environment. |
| 68 | +2. Run `./build_wasm.sh`. |
| 69 | +3. Run `./demo/web/serve.sh` and visit `http://127.0.0.1:8000`. |
59 | 70 |
|
60 | 71 | ## 📜 Acknowledgments |
| 72 | + |
61 | 73 | This project is a port of the [Pathfinder](https://github.com/servo/pathfinder) engine developed by the Servo project. |
0 commit comments