diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-07-11 14:31:05 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-07-17 12:20:03 -0700 |
commit | 8ae70105463db78699ef3743fb24503ed8feb054 (patch) | |
tree | e5a8479f22d1beb097f43bd4e36922d2cf4bd56e /src/mbgl/shaders | |
parent | 1d15ed64dcf78daa9459247127857513608c18ad (diff) | |
download | qtlocation-mapboxgl-8ae70105463db78699ef3743fb24503ed8feb054.tar.gz |
[core][ios][android][macos] Use premultiplied image directly for RasterTile and ImageSource, un-premultiply in the shader for blending
Diffstat (limited to 'src/mbgl/shaders')
-rw-r--r-- | src/mbgl/shaders/raster.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbgl/shaders/raster.cpp b/src/mbgl/shaders/raster.cpp index eb7a2db240..f454078310 100644 --- a/src/mbgl/shaders/raster.cpp +++ b/src/mbgl/shaders/raster.cpp @@ -45,6 +45,12 @@ void main() { // read and cross-fade colors from the main and parent tiles vec4 color0 = texture2D(u_image0, v_pos0); vec4 color1 = texture2D(u_image1, v_pos1); + if (color0.a > 0.0) { + color0.rgb = color0.rgb / color0.a; + } + if (color1.a > 0.0) { + color1.rgb = color1.rgb / color1.a; + } vec4 color = mix(color0, color1, u_fade_t); color.a *= u_opacity; vec3 rgb = color.rgb; |