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

Enable anisotropic filtering only beyond 20 degrees pitch #12577

Merged
merged 13 commits into from
Mar 6, 2023

Conversation

stepankuzmin
Copy link
Contributor

@stepankuzmin stepankuzmin commented Feb 20, 2023

Enable anisotropic filtering on tiles beyond 20 degrees pitch to prevent it from compromising image crispness on flat or low-tilted maps. This is a backport from GL Native. Closes #7331

// Enable trilinear filtering on tiles only beyond 20 degrees pitch,
// to prevent it from compromising image crispness on flat or low tilted maps.
if (tile.texture.useMipmap && context.extTextureFilterAnisotropic && painter.transform.pitch > 20) {
gl.texParameterf(gl.TEXTURE_2D, context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, context.extTextureFilterAnisotropicMax);
}

Also:

  • Update Docker Image to the latest Node v14
  • Lower the baseline for some render tests mostly because Firefox results are slightly different from Chrome in some tests
  • Bumps puppeteer-core and selenium-webdriver to the latest versions

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Enable anisotropic filtering on tiles beyond 20 degrees pitch to prevent it from compromising image crispness on flat or low-tilted maps.</changelog>

src/source/tile.js Outdated Show resolved Hide resolved
Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! One final thing I'd check just in case is that the filter on draw doesn't incur any performance penalties, but otherwise good to go. Not sure what's going on with the CodeBuild failing but I guess that's a fluke.

@stepankuzmin
Copy link
Contributor Author

I've run a benchmap, and it seems that the fix doesn't affect the rendering performance https://sites.mapbox.com/benchmap-js-results/runs/1358

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

Successfully merging this pull request may close these issues.

raster-resampling has no effect on raster tiles (eg. nearest neighbor is still blurry)
2 participants