-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GL: improve text rendering performance and quality #24605
Conversation
Can you do GLES also? |
I'm planning to. It is straight forward. I just want to get this PR merged before, so I don't have to incorporate possible change requests twice. |
For me scrolling labels stopped working with this change. OS: Arch |
Oh, yeah. (What have I got myself into...) |
Fixed the subs. But I have no idea where the snippet you've posted might be. Every instance of scrolling text (I could find) is working fine for me. |
4f362c6
to
a7283ef
Compare
Description
The PR moves the mostly CPU driven vertex manipulation of our font system to the GPU. It also improves upon the quality of the rendered text.
Motivation and context
Our font engine has been plagued with quality issues when animating. Especially zooming would look really bad. Letters would jitter when doing the animation, and would rest in "random" positions. Each glyph could stretch in both directions (each glyph in a text body could be distorted differently).
Rotated glyphs are distorted as well. An "H" might look a bit like an "A", as the lower portion might stretch while the upper portion might shrink.
Text shadow would be misaligned if zoomed.
Besides the quality issues, the amount of geometry processing done on the CPU was unjustified. Zooming and rotating would be processed on the CPU. Each frame, a new set of vertex data would have been calculated and uploaded.
On the GPU side, the new default shader will perform better (one less matrix multiplication). The GPU based clipping shader will perform roughly the same.
Overall, the code will be way less complex (when GLES and DX are adjusted).
How has this been tested?
Builds and runs fine. I took some comparison screenshots.
What is the effect on users?
Screenshots (if appropriate):
The string "Years" used in Estuary, enlarged by a zoom animation. Left: previous implementation. Right: fix. Note the better aligned shadow:
The watched status of Arctic Zephyr Reloaded. The letters are totally crooked in the old implementation (left):
Types of change
Checklist: