summaryrefslogtreecommitdiff
path: root/src/mbgl/shaders/extrusion_texture.cpp
diff options
context:
space:
mode:
authorLauren Budorick <lauren@mapbox.com>2017-04-27 15:56:55 -0700
committerGitHub <noreply@github.com>2017-04-27 15:56:55 -0700
commitf6e79d70735361438655f279c8699a786d25458c (patch)
treecc01ae7aba097bae4aa84beb12ac6b8f34f4d51a /src/mbgl/shaders/extrusion_texture.cpp
parent839ad87f37a4880804fb4c79157d998ac59954b5 (diff)
downloadqtlocation-mapboxgl-f6e79d70735361438655f279c8699a786d25458c.tar.gz
[core] Render fill-extrusion layers (#8431)
Diffstat (limited to 'src/mbgl/shaders/extrusion_texture.cpp')
-rw-r--r--src/mbgl/shaders/extrusion_texture.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mbgl/shaders/extrusion_texture.cpp b/src/mbgl/shaders/extrusion_texture.cpp
new file mode 100644
index 0000000000..c756db181c
--- /dev/null
+++ b/src/mbgl/shaders/extrusion_texture.cpp
@@ -0,0 +1,39 @@
+// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
+
+#include <mbgl/shaders/extrusion_texture.hpp>
+
+namespace mbgl {
+namespace shaders {
+
+const char* extrusion_texture::name = "extrusion_texture";
+const char* extrusion_texture::vertexSource = R"MBGL_SHADER(
+uniform mat4 u_matrix;
+uniform vec2 u_world;
+attribute vec2 a_pos;
+varying vec2 v_pos;
+
+void main() {
+ gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);
+
+ v_pos.x = a_pos.x;
+ v_pos.y = 1.0 - a_pos.y;
+}
+
+)MBGL_SHADER";
+const char* extrusion_texture::fragmentSource = R"MBGL_SHADER(
+uniform sampler2D u_image;
+uniform float u_opacity;
+varying vec2 v_pos;
+
+void main() {
+ gl_FragColor = texture2D(u_image, v_pos) * u_opacity;
+
+#ifdef OVERDRAW_INSPECTOR
+ gl_FragColor = vec4(0.0);
+#endif
+}
+
+)MBGL_SHADER";
+
+} // namespace shaders
+} // namespace mbgl