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

Anti-aliasing fails with fill-image #768

Closed
peterqliu opened this issue Oct 10, 2014 · 12 comments
Closed

Anti-aliasing fails with fill-image #768

peterqliu opened this issue Oct 10, 2014 · 12 comments
Assignees
Labels

Comments

@peterqliu
Copy link
Contributor

Vis-a-vis solid-color polygons. Most apparent at coastlines.

@jfirebaugh
Copy link
Contributor

@peterqliu Can you supply a test case style please?

@peterqliu
Copy link
Contributor Author

check out the jaggies

@mourner
Copy link
Member

mourner commented Oct 30, 2014

Hmm, it throws Uncaught SyntaxError: Unexpected token ] in mapbox-gl.js for me — @jfirebaugh any idea why?

@jfirebaugh
Copy link
Contributor

The style is invalid JSON. @peterqliu looks like it was broken in the last commit.

@mourner
Copy link
Member

mourner commented Oct 30, 2014

Hmm, why does it report mapbox-gl.js error? We probably should have a better error thrown when Mapbox GL fails to parse the JSON.

@peterqliu
Copy link
Contributor Author

@jfirebaugh @mourner my bad, now fixed

@ansis
Copy link
Contributor

ansis commented Mar 29, 2016

We need a new patterned outline shader to fix this. The shader would be similar to the outline shader but would read the correct color value from a texture just like the pattern shader.

@ansis
Copy link
Contributor

ansis commented Mar 29, 2016

osx has a useful feature that lets you zoom in and magnify pixels that could be useful for this.

  • open the Accessibility system preferences
  • check Use scroll gesture with modifier keys to zoom
  • uncheck Smooth images

You should now be able to use control + scrolling to zoom in on pixels.

@mollymerp mollymerp self-assigned this Mar 30, 2016
@ansis
Copy link
Contributor

ansis commented Mar 30, 2016

@mollymerp It's sounds like you already have a good idea about how to approach this. In case it helps, this is how I'd break it down:

  • I'd duplicate the outline shader shaders/outline.*.glsl and set it up in js/render/painter/use_program.js
  • modify js/render/draw_fill.js so that it uses the new pattern outline program to render a solid red outline for all fill patterns. much of this and drawStroke might need to be duplicated
  • the red outline should now show up when you render your test case
  • switch the test case to a pattern with a lot of sharp color variation
  • copy the relevant parts of the pattern shader to the pattern outline shader, update js/render/painter/use_program.js, and then set it up in /js/render/draw_fill.js.

@mollymerp
Copy link
Contributor

working on this in #2372

@ansis
Copy link
Contributor

ansis commented Apr 22, 2016

merged in #2372

@ansis ansis closed this as completed Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants