Bump GL-JS

Backport GL-JS fix 'Hide glyphs behind the camera'(https://github.com/mapbox/mapbox-gl-js/pull/9229)
This commit is contained in:
zmiao
2020-02-10 23:27:07 +02:00
parent e0b1642825
commit 7424c4eecb
10 changed files with 486 additions and 433 deletions

View File

@@ -15,9 +15,9 @@ struct ShaderSource;
template <>
struct ShaderSource<SymbolIconProgram> {
static constexpr const char* name = "symbol_icon";
static constexpr const uint8_t hash[8] = {0xa9, 0xd8, 0x73, 0xdf, 0xd9, 0xd8, 0x82, 0xf2};
static constexpr const uint8_t hash[8] = {0x17, 0x8a, 0xb9, 0xa4, 0x9d, 0xd2, 0xe1, 0x90};
static constexpr const auto vertexOffset = 50247;
static constexpr const auto fragmentOffset = 52996;
static constexpr const auto fragmentOffset = 53077;
};
constexpr const char* ShaderSource<SymbolIconProgram>::name;
@@ -142,6 +142,10 @@ void main() {
vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);
gl_Position = u_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * max(a_minFontScale, fontScale) + a_pxoffset / 16.0), 0.0, 1.0);
// Symbols might end up being behind the camera. Modify z-value to be out of visible bounds
// if this is the case, otherwise ignore depth. -1.1 is safely out of the visible depth range [-1, 1]
gl_Position.z = mix(-1.1 * gl_Position.w, gl_Position.z, float(projected_pos.w > 0.0));
v_tex = a_tex / u_texsize;
vec2 fade_opacity = unpack_opacity(a_fade_opacity);
float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;