Notice/Limitations:
Even though the feature has been tested internally, it is likely that there are still some issues with it. There are some planned optimizations in different steps of the process, but its core idea will remain intact. It doesn't work on all platforms - some GLES2 and DirectX9 devices don't support it, it has some known issues on Nintendo Switch and it hasn't been tested on Linux. The Nintendo Switch and Linux issues will be resolved in a newer version, the GLES2/DirectX9 ones will most likely not be solved as they are caused by platform limitations - that's why a fallback to the algorithm that has been used so far is implemented there.
What is the new feature?
It's a new way to generate text atlases. So far we have been generating glyphs on the CPU. At lower generation size, there were some visual quality problems. At higher generation size the cost was usually prohibitively expensive in terms of processing power. Furthermore that approach was stopping us from implementing another important feature, which we will implement in the following releases - text outlines used for stroked text. The new experimental solution does most of the work on the GPU and that gives us the ability to generate even higher resolution text atlases without increase in CPU usage. This allows users to choose desired generation to best suit their use case and balance between text visual quality required and memory used.
Comparison with the old algorithm
We have already mentioned that the new algorithm is very scalable in regard to glyph generation size as it relates to CPU usage whereas the old one wasn't. It also allows us to implement nice-looking outlines - again something that the old algorithm wasn't capable of. A picture says a thousand words, so...
Before @ default(52px) generation size:
SDFGPU @ default(52px) generation size:
Outlines @ default(52px) generation size with 8px spread:
How to use it?
Atlas with different generation size:
SDFGPU atlas @ default(52px) generation size:
SDFGPU atlas @ 96px generation size:
SDFGPU atlas @ 128px generation size:
Text quality with different generation size:
SDFGPU text quality @ default(52px) generation size:
SDFGPU text quality @ 96px generation size:
SDFGPU text quality @ 128px generation size:
Atlas with different spread:
SDFGPU atlas @ 128px generation size with 2px spread:
SDFGPU atlas @ 128px generation size with 8px spread:
SDFGPU atlas @ 128px generation size with 12px spread:
Outline width with different spread:
Outline width 52px - capped to maxOutlineWidth @ 128px generation size with 2px spread:
Outline width 52px - capped to maxOutlineWidth @ 128px generation size with 8px spread:
Outline width 52px - capped to maxOutlineWidth @ 128px generation size with 12px spread: