Skip to content

Commit

Permalink
Fix blurry map-aligned labels on terrain (#10296)
Browse files Browse the repository at this point in the history
* fix blurry map-pitched labels on terrain

* update render tests
  • Loading branch information
mourner authored Jan 15, 2021
1 parent 4eda278 commit 07179fe
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render/program/symbol_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ const symbolSDFUniformValues = (
texSize: [number, number],
isHalo: boolean
): UniformValues<SymbolSDFUniformsType> => {
const transform = painter.transform;
const {cameraToCenterDistance, _pitch} = painter.transform;

return extend(symbolIconUniformValues(functionType, size,
rotateInShader, pitchWithMap, painter, matrix, labelPlaneMatrix,
glCoordMatrix, isText, texSize), {
'u_gamma_scale': (pitchWithMap ? Math.cos(transform._pitch) * transform.cameraToCenterDistance : 1),
'u_gamma_scale': pitchWithMap ? cameraToCenterDistance * Math.cos(painter.terrain ? 0 : _pitch) : 1,
'u_device_pixel_ratio': browser.devicePixelRatio,
'u_is_halo': +isHalo
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 07179fe

Please sign in to comment.