-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Small fonts have misaligned glyphs #8474
Comments
This doesn't seem to happen when devicePixelRatio is 1.0 (at least I don't see the problem on my achine), so I think you're right that it's #8351 related. |
@lilleyse @IanLilleyT Since this is a recent regression, any change we can get to it for the next release? (It's okay if the answer is no, just figured I'd ask). I assume this is completely orthogonal to #7376? |
This is tricky... The old label code did pixel ratio stuff on the JS side. Then the vertex attributes (scale, offset, etc) were quantized and packed together to use as few attributes as possible. The new code does the attribute quantization the same but does the pixel ratio in the shader, which exaggerates this quantization error. 12px with that font could be uniquely bad looking depending on where the values are rounding from. Even the Cesium 1.62 version at 12px looks slightly wrong on the first 'a' This comment in
Question is, do we go back to doing pixel ratio on the JS side or figure out how to improve the vertex attribute compression... |
This isn't a fix to the underlying issue, but I am achieving a better label solution creating an HTML canvas element and using it as a billboard.
|
Hello, @IanLilleyT as pointed out I think issue is related to 'compressed vertex attributes that coerce it to an integer'. translate property in billboard coerces to int value and this issue occurs. We decided to pass translate property to shader directly without compression, however we lose compression. What are pros and cons of compression? Are there any alternatives? Thank you so much |
I'm experiencing this bug and the billboard workaround has its own problems when I have 50 points with labels. |
My workaround was to keep the font at 30px and use scaleByDistance. Using scale worked some times and was perhaps better than nothing, but with scaleByDistance it looked even better (even though I set the nearValue and farValue to the same thing) |
This came up in this forum thread. As noted there, the effect appears to be much more exaggerated on Mac as opposed to Linux (and Windows too, I believe).
@r20's workaround of using a larger font size and scaling down with |
Originally reported here: #4108 (comment)
Small text in labels seems to break the alignment:
This is a 12px font. It's less visible but still there at 24px, and not visible at 40px. This seems to happen regardless of whether the label is created with a small size font, or just a scaled down with the
scale
property. See this Sandcastle to explore this.You can also see this in the Labels SDF Sandcastle if you turn off the animating morgantown to make it easier to see on a scaled down "Philadelphia" label.
This used to work as of 1.62. I'm guessing it's something we overlooked in #8351? CC @IanLilleyT
Here's a 1.62 Sandcastle showing it works correctly.
The text was updated successfully, but these errors were encountered: