make line-opacity work with line-image
js: 0e9a86e3553913abb8ebb3d8926e2b99db8d4008
This commit is contained in:
@@ -138,6 +138,7 @@ void Painter::renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, c
|
||||
linepatternShader->u_pattern_tl = imagePos.tl;
|
||||
linepatternShader->u_pattern_br = imagePos.br;
|
||||
linepatternShader->u_fade = fade;
|
||||
linepatternShader->u_opacity = properties.opacity;
|
||||
|
||||
MBGL_CHECK_ERROR(glActiveTexture(GL_TEXTURE0));
|
||||
spriteAtlas.bind(true);
|
||||
|
||||
@@ -6,6 +6,7 @@ uniform vec2 u_pattern_size;
|
||||
uniform vec2 u_pattern_tl;
|
||||
uniform vec2 u_pattern_br;
|
||||
uniform float u_fade;
|
||||
uniform float u_opacity;
|
||||
|
||||
uniform sampler2D u_image;
|
||||
|
||||
@@ -31,7 +32,7 @@ void main() {
|
||||
|
||||
vec4 color = texture2D(u_image, pos) * (1.0 - u_fade) + u_fade * texture2D(u_image, pos2);
|
||||
|
||||
color.rgb *= color.a; // premultiply
|
||||
alpha *= u_opacity;
|
||||
|
||||
gl_FragColor = color * alpha;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
Uniform<float> u_point = {"u_point", *this};
|
||||
Uniform<float> u_blur = {"u_blur", *this};
|
||||
Uniform<float> u_fade = {"u_fade", *this};
|
||||
Uniform<float> u_opacity = {"u_opacity", *this};
|
||||
|
||||
private:
|
||||
int32_t a_pos = -1;
|
||||
|
||||
Reference in New Issue
Block a user