summaryrefslogtreecommitdiff
path: root/src/mbgl/shaders/fill_extrusion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/shaders/fill_extrusion.cpp')
-rw-r--r--src/mbgl/shaders/fill_extrusion.cpp60
1 files changed, 57 insertions, 3 deletions
diff --git a/src/mbgl/shaders/fill_extrusion.cpp b/src/mbgl/shaders/fill_extrusion.cpp
index ea1c80545e..ad14e4f32e 100644
--- a/src/mbgl/shaders/fill_extrusion.cpp
+++ b/src/mbgl/shaders/fill_extrusion.cpp
@@ -18,21 +18,51 @@ attribute float a_edgedistance;
varying vec4 v_color;
+
+#ifndef HAS_UNIFORM_u_base
uniform lowp float a_base_t;
attribute lowp vec2 a_base;
varying lowp float base;
+#else
+uniform lowp float u_base;
+#endif
+
+#ifndef HAS_UNIFORM_u_height
uniform lowp float a_height_t;
attribute lowp vec2 a_height;
varying lowp float height;
+#else
+uniform lowp float u_height;
+#endif
+
+#ifndef HAS_UNIFORM_u_color
uniform lowp float a_color_t;
attribute highp vec4 a_color;
varying highp vec4 color;
+#else
+uniform highp vec4 u_color;
+#endif
void main() {
+
+#ifndef HAS_UNIFORM_u_base
base = unpack_mix_vec2(a_base, a_base_t);
+#else
+ lowp float base = u_base;
+#endif
+
+#ifndef HAS_UNIFORM_u_height
height = unpack_mix_vec2(a_height, a_height_t);
+#else
+ lowp float height = u_height;
+#endif
+
+#ifndef HAS_UNIFORM_u_color
color = unpack_mix_vec4(a_color, a_color_t);
+#else
+ highp vec4 color = u_color;
+#endif
base = max(0.0, base);
height = max(0.0, height);
@@ -76,14 +106,38 @@ void main() {
)MBGL_SHADER";
const char* fill_extrusion::fragmentSource = R"MBGL_SHADER(
varying vec4 v_color;
+
+#ifndef HAS_UNIFORM_u_base
varying lowp float base;
+#else
+uniform lowp float u_base;
+#endif
+
+#ifndef HAS_UNIFORM_u_height
varying lowp float height;
+#else
+uniform lowp float u_height;
+#endif
+
+#ifndef HAS_UNIFORM_u_color
varying highp vec4 color;
+#else
+uniform highp vec4 u_color;
+#endif
void main() {
-
-
-
+
+#ifdef HAS_UNIFORM_u_base
+ lowp float base = u_base;
+#endif
+
+#ifdef HAS_UNIFORM_u_height
+ lowp float height = u_height;
+#endif
+
+#ifdef HAS_UNIFORM_u_color
+ highp vec4 color = u_color;
+#endif
gl_FragColor = v_color;