From c59c2342257cb1f5e4cf2a9c8c8812a338674e46 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 20 Aug 2019 15:51:23 -0400 Subject: [PATCH] fix rendering fills above semi-translucent fill extrusions --- src/render/painter.js | 2 + .../fill-extrusion--fill-opaque/expected.png | Bin 0 -> 195 bytes .../fill-extrusion--fill-opaque/style.json | 64 +++++++++++++++++ .../expected.png | Bin 0 -> 203 bytes .../style.json | 65 ++++++++++++++++++ .../style.json | 1 + .../expected.png | Bin 203 -> 230 bytes .../style.json | 1 + 8 files changed, 133 insertions(+) create mode 100644 test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png create mode 100644 test/integration/render-tests/combinations/fill-extrusion--fill-opaque/style.json create mode 100644 test/integration/render-tests/combinations/fill-extrusion--fill-translucent/expected.png create mode 100644 test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json diff --git a/src/render/painter.js b/src/render/painter.js index ffdfec02cd5..9ad85b4179a 100644 --- a/src/render/painter.js +++ b/src/render/painter.js @@ -274,6 +274,8 @@ class Painter { } stencilModeFor3D(): StencilMode { + this.currentStencilSource = undefined; + if (this.nextStencilID + 1 > 256) { this.clearStencil(); } diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png b/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..32dc67dd0fdd0bdc56bc6dd3ace60e111aba84c0 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKc{L#3+k+bg zn++IP4t}2fEQ4KWtAoSIikRl(QmXa4JtnDmPP+2^sK|HT;|GJTvnGF7-s^d^{}q(tAr9|A1BuPu@VrvLT{SM;2u;u$pmpvdj7H5K+ZE@sE-8O;0h z@`TFrnj4q1V`nH%;eP70GeD16>Y&N(-q>DiprIgC_m#ESgxk7Z{o7lhdl)=j{an^L HB{Ts5;Vn&C literal 0 HcmV?d00001 diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json new file mode 100644 index 00000000000..ba22d1e0b8d --- /dev/null +++ b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json @@ -0,0 +1,65 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "center": [ + -113.26903, + 35.9654 + ], + "zoom": 11, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -113.27384948730469, + 35.962 + ], + [ + -113.26421051269531, + 35.962 + ], + [ + -113.26421051269531, + 35.97 + ], + [ + -113.27384948730469, + 35.97 + ], + [ + -113.27384948730469, + 35.962 + ] + ] + ] + } + } + }, + "layers": [ + { + "id": "fill-extrusion-translucent", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-color": "red" + } + }, + { + "id": "fill-translucent", + "type": "fill", + "source": "geojson", + "paint": { + "fill-opacity": 0.5, + "fill-color": "blue" + } + } + ] +} diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json index ef63e9c3da0..776b6c86944 100644 --- a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json +++ b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json @@ -49,6 +49,7 @@ "type": "fill-extrusion", "source": "geojson", "paint": { + "fill-extrusion-opacity": 0.5, "fill-extrusion-color": "red" } }, diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png index b37e2ada066def728297f7385a5ee5e56ad4e054..84c0263e05cb4e0651875f30d6ee7d44bc8c0b26 100644 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ydu{YLn;`b9(3eA| z5ylk`oP8A!7+F<95ANol65vvh=~U+SNW~8eO6mH$spsvv#%;Ab4@LZ(=u;%O-kkl` zw^m84s<8Ar}+0?uhV-DbU1^jtDnm{r-UW| DNatG! literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKc`YE`+k*!= znH(8d4&J-C!>^{}q(tAr9|A1BuPu@VrvLT{SM;2u;u$pmpvdj7H5K+ZE@sE-8O;0h z@`TFrnj4q1V`nH%;eP70GeD16>Y&N(-q>DiprIgC_m#ESgxk7Z{o7lhdl)=j{an^L HB{Ts5;Vn&C diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json index ba22d1e0b8d..04fe1149d95 100644 --- a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json +++ b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json @@ -49,6 +49,7 @@ "type": "fill-extrusion", "source": "geojson", "paint": { + "fill-extrusion-opacity": 0.5, "fill-extrusion-color": "red" } },