Skip to content
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

SDF label pixel ratio inconsistency #8376

Open
IanLilleyT opened this issue Nov 7, 2019 · 0 comments
Open

SDF label pixel ratio inconsistency #8376

IanLilleyT opened this issue Nov 7, 2019 · 0 comments

Comments

@IanLilleyT
Copy link
Contributor

IanLilleyT commented Nov 7, 2019

Discussion started here: #8351 (comment)

The SDF label looks different at 1.0 vs 2.0 pixel ratio:

none1

none2

But with a czm_pixelRatio "fix" in BillboardCollectionFS.glsl, they look the same:
both2
both1

However, this removes the crispness on normal labels:
1.0 PR:
Screen Shot 2019-11-07 at 9 48 00 AM
2.0 PR
Screen Shot 2019-11-07 at 9 47 31 AM
2.0 PR with pixelRatio "fix"
Screen Shot 2019-11-07 at 9 48 07 AM

I'm not sure which of these approaches to use. The underlying problem is shader derivatives. The smoothing is based off the fwidth of the texture's distance value and the sample offset is based of the dFdx and dFdy of the texture coordinates. For pixelRatio 2.0 these values are effectively half of pixelRatio 1.0, resulting in the cripser image. Might require a deeper dive into SDF labels at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants