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

Aliasing on alternate-projected edges of the world #11164

Open
mourner opened this issue Oct 22, 2021 · 2 comments
Open

Aliasing on alternate-projected edges of the world #11164

mourner opened this issue Oct 22, 2021 · 2 comments
Labels

Comments

@mourner
Copy link
Member

mourner commented Oct 22, 2021

There is visible aliasing ("steps") on edges of the world when using alternate projections:

Fill layers are anti-aliased, but there was previously no need to anti-alias background layers or modify tile clipping masks to accommodate anti-aliased edges. This changes with alternate projections. Not sure how involved that is, but if it's an easy fix, we should do it before the final release to make thematic world maps look nicer. cc @ansis @ryanhamley

@mourner mourner added this to the projections milestone Oct 22, 2021
@ansis
Copy link
Contributor

ansis commented Oct 22, 2021

I think this could be very tricky to do as part of the fill layer (water). We might need to draw a world outline above all the layers that makes some these pixels more transparent. We would also need to get that under labels that can extend beyond the map.

  • would we ever want to support a visible outline for the map?
  • is this related to a potential halo effect that we might want for globe view?
@rreusser
Copy link
Contributor

rreusser commented Oct 22, 2021

This notebook illustrates the standard derivatives method for antialiasing, which might possibly work here: Basically if you divide in a fragment shader 1) any function which falls off to zero at the desired point, by 2) its derivative with respect to screen pixels, you get: a function that goes to zero over one pixel and can be used for antialiasing. This works with analytical derivatives as well as those computed with oes_standard_derivatives (which GL JS doesn't use currently, but which is universally supported, and can be relied upon to be present)

Edit: Oops, wrong link, sorry: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants