Update the README for Pathfinder 3

This commit is contained in:
Patrick Walton 2019-02-26 15:24:25 -08:00
parent 92777c6346
commit 18e0a06df8
1 changed files with 35 additions and 43 deletions

View File

@ -1,69 +1,61 @@
# Pathfinder 2 # Pathfinder 3
Pathfinder 2 is a fast, practical, work in progress GPU-based rasterizer for fonts and vector Pathfinder 3 is a fast, practical, GPU-based rasterizer for fonts and vector graphics using OpenGL
graphics using OpenGL and OpenGL ES 2.0+. and OpenGL ES 3.0+.
Please note that Pathfinder is under heavy development and is incomplete in various areas. Please note that Pathfinder is under heavy development and is incomplete in various areas.
The project features: The project features:
* Low setup time. Typical glyph outlines can be prepared for GPU rendering in about 5 microseconds
each (typically O(n log n) in the number of vertices), making Pathfinder suitable for dynamic
environments. The setup process is lossless and fully resolution independent; paths need only be
prepared once and can thereafter be rendered at any zoom level without any loss in quality.
Pathfinder can also render outlines without any mesh at all, reducing the setup time to nearly
zero, at the cost of some runtime performance. For static paths such as game assets, the
resulting meshes can be saved to disk to avoid having to generate them at runtime.
* High quality antialiasing. Pathfinder can compute exact fractional trapezoidal area coverage on a * High quality antialiasing. Pathfinder can compute exact fractional trapezoidal area coverage on a
per-pixel basis for the highest-quality antialiasing, provided that either OpenGL 3.0+ or a few per-pixel basis for the highest-quality antialiasing possible (effectively 256xAA).
common extensions are available. Supersampling is available as an alternative for 3D scenes
and/or lower-end hardware.
* Fast rendering, even at small pixel sizes. Even on lower-end GPUs, Pathfinder typically matches * Fast CPU setup, making full use of parallelism. Pathfinder 3 uses the Rayon library to quickly
or exceeds the performance of the best CPU rasterizers. The difference is particularly pronouced perform a CPU tiling prepass to prepare vector scenes for the GPU. This prepass can be pipelined
at large sizes, where Pathfinder regularly achieves multi-factor speedups. All shaders have no with the GPU to hide its latency.
loops and minimal branching.
* Fast GPU rendering, even at small pixel sizes. Even on lower-end GPUs, Pathfinder typically
matches or exceeds the performance of the best CPU rasterizers. The difference is particularly
pronouced at large sizes, where Pathfinder regularly achieves multi-factor speedups. All shaders
have no loops and minimal branching.
* Advanced font rendering. Pathfinder can render fonts with slight hinting and can perform subpixel * Advanced font rendering. Pathfinder can render fonts with slight hinting and can perform subpixel
antialiasing on LCD screens. It can do stem darkening/font dilation like macOS and FreeType in antialiasing on LCD screens. It can do stem darkening/font dilation like macOS and FreeType in
order to make text easier to read at small sizes. The library also has support for gamma order to make text easier to read at small sizes. The library also has support for gamma
correction. correction.
* Support for full vector scenes. Pathfinder 2 is designed to efficiently handle workloads that * Support for SVG. Pathfinder 3 is designed to efficiently handle workloads that consist of many
consist of many overlapping vector paths, such as those commonly found in SVG and PDF files. It overlapping vector paths, such as those commonly found in SVG and PDF files. It can perform
makes heavy use of the hardware Z buffer to perform occlusion culling, which often results in occlusion culling, which often results in dramatic performance wins over typical software
dramatic performance wins over typical software renderers that use the painter's algorithm. renderers that use the painter's algorithm. A simple loader that leverages the `resvg` library
to render a subset of SVG is included, so it's easy to get started.
* 3D capability. Pathfinder 2 can render fonts and vector paths in 3D environments. Vector meshes * 3D capability. Pathfinder can render fonts and vector paths in 3D environments without any loss
are rendered just like any other mesh, with a simple shader applied. in quality. This is intended to be useful for vector-graphics-based user interfaces in VR, for
example.
* Lightweight. Unlike large vector graphics packages that mix and match many different algorithms,
Pathfinder 3 uses a single, simple technique. It consists of a set of modular crates, so
applications can pick and choose only the components that are necessary to minimize dependencies.
* Portability to most GPUs manufactured in the last decade, including integrated and mobile GPUs. * Portability to most GPUs manufactured in the last decade, including integrated and mobile GPUs.
Geometry, tessellation, and compute shader functionality is not required. Geometry, tessellation, and compute shader functionality is not required.
## Building ## Building
Pathfinder 2 is a set of modular packages, allowing you to choose which parts of the library you Pathfinder 3 is a set of modular packages, allowing you to choose which parts of the library you
need. A WebGL demo is included, so you can try Pathfinder right in your browser. (Please note that, need. An SVG rendering demo, written in Rust, is included, so you can try Pathfinder out right
like the rest of Pathfinder, it's under heavy development and has known bugs.) away. It also provides an example of how to use the library. (Note that, like the rest of
Pathfinder, the demo is under heavy development and has known bugs.)
To run the demo, make sure [Node.js](https://nodejs.org/en/), [nightly Rust](https://doc.rust-lang.org/1.5.0/book/nightly-rust.html) and [CMake](https://cmake.org/install/) are installed, then run the following commands: Running the demo is as simple as:
$ cd demo/client $ cd demo/native
$ npm install $ RUSTFLAGS="-C target-cpu=native" cargo run --release
$ npm run build
$ cd ../server
$ cargo run --release
Then navigate to http://localhost:8000/. On macOS, it is recommended that you force the use of the integrated GPU, as issues with Apple's
OpenGL drivers may limit performance on discrete GPUs. You can use
## Testing [gfxCardStatus.app](https://gfx.io/) for this.
Pathfinder contains reference tests that compare its output to that of other rendering libraries,
such as Cairo. To run them, install Cairo and FreeType if necessary, then perform the above steps,
substituting the last line with:
$ cargo run --release --features reftests
## Authors ## Authors
@ -72,7 +64,7 @@ community.
The logo was designed by Jay Vining. The logo was designed by Jay Vining.
Pathfinder abides by the same Code of Conduct as Rust itself. Contributors to Pathfinder are expected to abide by the same Code of Conduct as Rust itself.
## License ## License