mapbox / mapbox/mapbox-gl-js

Remove mipmapping + anisotropic filtering for raster tiles

Open
#4,580 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

GL native → GL JS performance :zap:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

We added a call to generateMipMap on a hunch in #112 a few years ago, and it has remained in the raster drawing code ever since. Mipmaps only make sense when the texture is scaled down significantly (way below 50% of its original size), as a mean to improve the quality of the texels used to calculate the fragment color. A few weeks ago, we added anisotropic filtering to improve the quality.

We never added mipmapping for raster tiles in Native, and I don't think we need to, given that we almost always draw the textures in a size that isn't smaller than half the original dimensions. Since we don't mipmap raster tiles, we also don't need anisotropic filtering.

We should remove the call to generateMipMap and consequently remove anisotropic filtering for raster tiles. This should achieve the near identical visual quality while reducing memory usage and making the code less complex.

https://github.com/mapbox/mapbox-gl-native/issues/8688

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the raster drawing code and the existing generateMipMap call, then trace where anisotropic filtering is enabled for raster tiles. Remove both raster-tile settings and verify raster rendering remains visually equivalent while texture setup no longer includes them.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.