Skip to content

Enable anisotropic filtering only beyond 20 degrees pitch - #12577

Merged
stepankuzmin merged 13 commits into
mainfrom
fix-anisotropic-filtering
Mar 6, 2023
Merged

stepankuzmin merged 13 commits into
mainfrom
fix-anisotropic-filtering

Conversation

@stepankuzmin

@stepankuzmin stepankuzmin commented Feb 20, 2023 •

Copy link
Copy Markdown
Contributor

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>

@stepankuzmin
stepankuzmin requested a review from a team as a code owner February 20, 2023 15:11
Comment thread src/source/tile.js Resolved
@stepankuzmin
stepankuzmin force-pushed the fix-anisotropic-filtering branch from 9d8aacd to 787508a Compare March 2, 2023 12:05

@mourner mourner left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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