diff --git a/src/render/program/symbol_program.js b/src/render/program/symbol_program.js index be27d61c4a2..ba1ea248769 100644 --- a/src/render/program/symbol_program.js +++ b/src/render/program/symbol_program.js @@ -192,12 +192,12 @@ const symbolSDFUniformValues = ( texSize: [number, number], isHalo: boolean ): UniformValues => { - 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 }); diff --git a/test/integration/render-tests/debug/terrain/collision-pitch-with-map-text-and-icon/expected.png b/test/integration/render-tests/debug/terrain/collision-pitch-with-map-text-and-icon/expected.png index 45a120926d4..68de38abb93 100644 Binary files a/test/integration/render-tests/debug/terrain/collision-pitch-with-map-text-and-icon/expected.png and b/test/integration/render-tests/debug/terrain/collision-pitch-with-map-text-and-icon/expected.png differ diff --git a/test/integration/render-tests/debug/terrain/collision-pitch-with-map/expected.png b/test/integration/render-tests/debug/terrain/collision-pitch-with-map/expected.png index 947840d6d8a..bb4f550ab76 100644 Binary files a/test/integration/render-tests/debug/terrain/collision-pitch-with-map/expected.png and b/test/integration/render-tests/debug/terrain/collision-pitch-with-map/expected.png differ diff --git a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map-terrain/expected.png b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map-terrain/expected.png index bc7a1f001b7..ef9800363de 100644 Binary files a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map-terrain/expected.png and b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map-terrain/expected.png differ diff --git a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-viewport-terrain/expected.png b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-viewport-terrain/expected.png index f9ef08997bc..7c8a4070415 100644 Binary files a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-viewport-terrain/expected.png and b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-viewport-terrain/expected.png differ