[core] Update shaders.

Implements 'icon-pitch-alignment' (issue #9345)
Fixes issue #9456 (map-aligned point label regression)
This commit is contained in:
Chris Loer
2017-07-11 11:22:39 -07:00
committed by Chris Loer
parent af10e2d3be
commit e8657becc5
23 changed files with 458 additions and 118 deletions

View File

@@ -52,6 +52,11 @@ Values makeValues(const bool isText,
const float pixelsToTileUnits = tile.id.pixelsToTileUnits(1.0, state.getZoom());
const bool pitchWithMap = values.pitchAlignment == style::AlignmentType::Map;
const bool rotateWithMap = values.rotationAlignment == style::AlignmentType::Map;
// Line label rotation happens in `updateLineLabels`
// Pitched point labels are automatically rotated by the labelPlaneMatrix projection
// Unpitched point labels need to have their rotation applied after projection
const bool rotateInShader = rotateWithMap && !pitchWithMap && !alongLine;
mat4 labelPlaneMatrix;
if (alongLine) {
@@ -84,6 +89,8 @@ Values makeValues(const bool isText,
uniforms::u_pitch::Value{ state.getPitch() },
uniforms::u_pitch_with_map::Value{ pitchWithMap },
uniforms::u_max_camera_distance::Value{ values.maxCameraDistance },
uniforms::u_rotate_symbol::Value{ rotateInShader },
uniforms::u_aspect_ratio::Value{ state.getSize().aspectRatio() },
std::forward<Args>(args)...
};
}