parent
1846ebd861
commit
c2368bb71e
71
README.md
71
README.md
|
@ -1,52 +1,63 @@
|
||||||
# Pathfinder
|
# Pathfinder 2
|
||||||
|
|
||||||
Pathfinder is a fast, practical GPU-based rasterizer for OpenType fonts using OpenGL 4.3. It
|
Pathfinder 2 is a fast, practical, work in progress GPU-based rasterizer for fonts and vector
|
||||||
features:
|
graphics using OpenGL and OpenGL ES 2.0+.
|
||||||
|
|
||||||
* Very low setup time. Glyph outlines can go from the `.otf` file to the GPU in a form ready for
|
Please note that Pathfinder is under heavy development and is incomplete in various areas.
|
||||||
rasterization in less than a microsecond. There is no expensive tessellation or preprocessing
|
|
||||||
step.
|
|
||||||
|
|
||||||
* High quality antialiasing. Unlike techniques that rely on multisample antialiasing, Pathfinder
|
The project features:
|
||||||
computes exact fractional trapezoidal area coverage on a per-pixel basis.
|
|
||||||
|
|
||||||
* Fast rendering, even at small pixel sizes. On typical systems, Pathfinder should easily exceed
|
* Low setup time. Typical glyph outlines can be prepared for GPU rendering in about 5 microseconds
|
||||||
the performance of the best CPU rasterizers.
|
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. For
|
||||||
|
static paths such as game assets, the resulting meshes can be saved to disk to avoid having to
|
||||||
|
generate them at runtime.
|
||||||
|
|
||||||
* Low memory consumption. The only memory overhead over the glyph and outline storage itself is
|
* High quality antialiasing. Pathfinder can compute exact fractional trapezoidal area coverage on a
|
||||||
that of a coverage buffer which typically consumes somewhere between 4MB-16MB and can be
|
per-pixel basis for crisp antialiasing, provided that either OpenGL 3.0+ or a few common
|
||||||
discarded under memory pressure. Outlines are stored on-GPU in a compressed format and usually
|
extensions are available. Supersampling is available as an alternative for 3D scenes and/or
|
||||||
take up only a few dozen kilobytes.
|
lower-end hardware.
|
||||||
|
|
||||||
* Portability to most GPUs manufactured in the last few years, including integrated GPUs.
|
* Fast 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.
|
||||||
|
|
||||||
|
* Support for full vector scenes. Pathfinder 2 is designed to efficiently handle workloads that
|
||||||
|
consist of many overlapping vector paths, such as those commonly found in SVG and PDF files. It
|
||||||
|
makes heavy use of the hardware Z buffer to perform occlusion culling, which often results in
|
||||||
|
dramatic performance wins over typical software renderers that use the painter's algorithm.
|
||||||
|
|
||||||
|
* 3D capability. Pathfinder 2 can render fonts and vector paths in 3D environments. Vector meshes
|
||||||
|
are rendered just like any other mesh, with a simple shader applied.
|
||||||
|
|
||||||
|
* Portability to most GPUs manufactured in the last decade, including integrated and mobile GPUs.
|
||||||
|
Geometry, tessellation, and compute shader functionality is not required.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Check out the code and run `cargo build --release`.
|
Pathfinder 2 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,
|
||||||
|
like the rest of Pathfinder, it's under heavy development and has known bugs.)
|
||||||
|
|
||||||
Try the demo with `cargo run --release --example lorem-ipsum -- resources/tests/nimbus-sans/NimbusSanL-Regu.ttf`.
|
To run the demo, make sure NPM and nightly Rust are installed, and run the following commands:
|
||||||
Use the mouse wheel or touchpad scrolling to move, and do the same while holding Alt or Option to
|
|
||||||
zoom.
|
|
||||||
|
|
||||||
As an alternative, debug builds (without the `--release`) build quickly and are typically fast,
|
$ cd demo/client
|
||||||
since most of the code runs on GPU.
|
$ npm install
|
||||||
|
$ npm run build
|
||||||
|
$ cd ../server
|
||||||
|
$ cargo run --release
|
||||||
|
|
||||||
On Windows, running the demos requires GLFW, which requires CMake to be installed and in your PATH.
|
Then navigate to http://localhost:8000/.
|
||||||
Get it from [cmake.org](https://cmake.org/).
|
|
||||||
|
|
||||||
On Linux, some development packages are needed to compile. On Ubuntu, the following line has been
|
|
||||||
reported to suffice to install them:
|
|
||||||
|
|
||||||
sudo apt-get install cmake libgl-dev libx11-dev xrandr-dev
|
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
The primary author is Patrick Walton (@pcwalton), with contributions from the Servo development
|
The primary author is Patrick Walton (@pcwalton), with contributions from the Servo development
|
||||||
community.
|
community.
|
||||||
|
|
||||||
The code is owned by the Mozilla Foundation.
|
Pathfinder abides by the same Code of Conduct as Rust itself.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Licensed under the same terms as Rust itself. See `LICENSE-APACHE` and `LICENSE-MIT`.
|
Licensed under the same terms as Rust itself. See `LICENSE-APACHE` and `LICENSE-MIT`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue