Commit Graph

13 Commits

Author SHA1 Message Date
Patrick Walton 86660572bd Upgrade ST-transforms to affine transforms where possible, and add
incomplete rotation support to the text demo
2017-11-29 17:06:52 -08:00
Patrick Walton 6942bb51ca Add support for full 3D transforms, including rotation, to SVG in XCAA mode. 2017-11-28 16:15:06 -08:00
Patrick Walton 314185684c Implement stem darkening and split ECAA into ECAA and MCAA.
We now implement stem darkening (also known as font dilation) like
macOS and FreeType under certain configurations. This pushes out font
outlines along their normals slightly in order to make small text easier
to read. This is especially important when performing gamma correction,
as otherwise text can end up too light.

Because the stem darkening is implemented in the vertex shader, it can
easily break the mesh. Therefore, I needed to implement a new rendering
mode that does not use the mesh. It's a variant of ECAA, and for
clarity's sake I've renamed the related antialiasing methods:

* MCAA stands for "mesh coverage antialiasing" and is the new name for
what was called "ECAA" prior to this patch.

* ECAA now stands for "edge coverage antialiasing". It does not use the
mesh but rather computes winding numbers from scratch for every pixel.
Surprisingly, despite being worse asymptotically, this usually ends up
being faster than MCAA at small font sizes, presumably because there are
fewer vertices to transform.

* XCAA, "exact coverage antialiasing" is a generic term that refers to
both ECAA and MCAA. References to ECAA have been changed to XCAA as
needed.
2017-10-15 13:28:49 -07:00
Patrick Walton 2a236319d4 Use regular VBOs instead of textures to store vertex positions for ECAA.
This improves performance at small font sizes a bit by reducing vertex
shading load.
2017-10-06 16:42:51 -07:00
Patrick Walton 6a7c013e61 Make the hints a uniform instead of a buffer texture.
Saves a good bit of memory traffic during vertex shading.
2017-10-05 19:14:52 -07:00
Patrick Walton 22d0eb7b24 Fix file headers in shaders/ 2017-10-03 15:32:03 -07:00
Patrick Walton f68da75c75 Implement SSAA for the 3D demo.
This commit additionally refactors transforms to be resolution-independent as much as possible throughout all the demos.
2017-09-12 19:43:43 -07:00
Patrick Walton eb9c0ceb4d Implement "slight" hinting by rounding x-heights up to the nearest pixel 2017-09-09 13:12:51 -07:00
Patrick Walton 3ee066bdf0 Implement subpixel ECAA 2017-09-07 14:58:41 -07:00
Patrick Walton 81a6f8f051 Enable early Z for edge detection and render only in the used area of the atlas 2017-08-23 19:18:24 -07:00
Patrick Walton 52afa359b4 Render a line of text using the atlas 2017-08-22 18:25:32 -07:00
Patrick Walton 653530be0b Add a curve shader for ECAA and refactor the line shader to minimize code duplication 2017-08-18 17:12:58 -07:00
Patrick Walton a9eeec39fe Implement the line antialiasing shader, untested as of yet 2017-08-18 11:44:17 -07:00