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
Bug: V8 MSDF text rendering quality #10463
Comments
heya @jakerdy thanks for sharing all the details - will try to take a look! |
heya! i think i have this fixed - but hard to verify! if you could test this branch out. that would be ace! |
Hi. Tested tooday, and yeah, it's better now. But most of issues still there. Fixed:
Still there:
I shoot couple videos that demonstrates how text looks in v7.1.0 and v8(pr-branch), showing most of this issues hope that will help to track down those problems more easily: |
Regarding antialiassing, I've checked my screens from this issue:
Specific points of interest (tints are good now, but AA is the same as here): As you can see, V8 has way narrower AA. There something wrong with coverage evaluation. Maybe you should rise alpha to power of 2.2, so that alpha went into linear color space, or something like that. I already changed msdf text rendering in v7, it also was maked as "migrate to v8" but, I think it would be separate problem on it's own: #9261 |
thanks for sharing more info - is there a way we could make a playground / repo to demonstrate pls? This will make it a load easier for me to address correctly. |
will add in the #9261 - that should be straight forward at least! :D |
FWI me and the team have been admiring the thoroughness of you Issues! such a great level of detail - I wish they were all like this! 😅 |
Ok, will try later tooday to make a usable example |
Making good examples, takes qute a bit of time... But, there it is: https://github.com/jakerdy/pixi-msdf-examples I've recreated all described problems, in side-by-side app, so that you could check it in V7 and V8 at the same time. Also there some controls that should help uderstand it "in motion". |
this is GREAT! leave it with me, il get it fixed up.. |
yoo! pushed up a couple of tweaks - everything sorted apart from the empty lines being skipped. Might do that as another PR as its not really and MSDF thing - but a BitmapText thing iyswim? Anyhoo - you example made it very easy to address the issues. Appreciate the effort! Thanks |
@jakerdy just wanted to say that this is an exceptional issue. The detail you put into this should be the gold standard for issues. Really amazing, we appreciate the effort! |
Pixi saved me endless amount of time, and made it possible to create very performant graph view for my app. So it is in my interests to make sure that the Pixi is doing well. Thank you for kind words, Pixi is a great project! |
Current Behavior
MSDF (and probably SDF) bitmap text in V8 has worst quality compared to V7.
About year ago, I made a PR that make MSDF text look better (#9261), and so far it was great, and I was happy with result. But tooday, I finnaly decided to move to V8, and found couple problems.
First one was about strange tint behaviour, and second - poor quality of MSDF text shader.
Problems with current implementation:
Text
andHTMLText
Good things about V8 BitmapText:
BitmapFont
use baseline property from .fnt file. V7 Didn't.Expected Behavior
Here you could see some comparisions:
Open it at 100% and swap between, you could see how much it changes.
Quality of AA
Skipped empty lines
Also there is demonstration of skipping empty lines in multiline text:
Lines shouldn't be skipped.
Tint inconsistency
Even if #10462 not bug but feature, there is inconsistency between
BitmapText
and other text's. Others just multiplied by tint, when BitmapText do something else, as graphics and sprites.Steps to Reproduce
It's pretty cumbersome to reproduce it in playground. I attach my fonts in zip, so that you could use it to test on your side...
Environment
pixi.js
version: e.g. 8.1.0Possible Solution
You could use my changes from (#9261).
It will require to change signature of function that evaluates SDF/MSDF alpha defined here:
src/scene/text/sdfShader/shader-bits/mSDFBit.ts
. It should get color of letters, in order to correctly estimate coverage.I did tried to do it my self, but didn't figure out how to do it correctly.
Additional Information
Anyway. Pixi v8 is great, new api's feels good and polished. Hope this buggs will be resolved and I could finnaly switch to V8...
The text was updated successfully, but these errors were encountered: