Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/drape
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-11-30 10:49:24 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-11-30 10:49:24 +0300
commit318509ff4f913375df5557bf928fade584bdd37d (patch)
tree78293aac46f97d0fe03a3d9cbf9cdbde4410d54a /drape
parentb629151b2588085b0df5d851c878e7beb7679605 (diff)
Tuned night style for traffic rendering
Diffstat (limited to 'drape')
-rw-r--r--drape/shaders/traffic_fragment_shader.fsh13
1 files changed, 7 insertions, 6 deletions
diff --git a/drape/shaders/traffic_fragment_shader.fsh b/drape/shaders/traffic_fragment_shader.fsh
index 2a190d10c3..26955308fd 100644
--- a/drape/shaders/traffic_fragment_shader.fsh
+++ b/drape/shaders/traffic_fragment_shader.fsh
@@ -7,25 +7,26 @@ uniform sampler2D u_maskTex;
uniform float u_opacity;
uniform float u_outline;
+uniform vec3 u_lightArrowColor;
+uniform vec3 u_darkArrowColor;
+uniform vec3 u_outlineColor;
+
const float kAntialiasingThreshold = 0.92;
const float kOutlineThreshold1 = 0.8;
const float kOutlineThreshold2 = 0.5;
-const vec3 kLightArrow = vec3(1.0, 1.0, 1.0);
-const vec3 kDarkArrow = vec3(107.0 / 255.0, 81.0 / 255.0, 20.0 / 255.0);
-
void main(void)
{
vec4 color = texture2D(u_colorTex, v_colorTexCoord);
float alphaCode = color.a;
vec4 mask = texture2D(u_maskTex, v_maskTexCoord);
color.a = u_opacity * (1.0 - smoothstep(kAntialiasingThreshold, 1.0, abs(v_halfLength)));
- color.rgb = mix(color.rgb, mask.rgb * mix(kLightArrow, kDarkArrow, step(alphaCode, 0.6)), mask.a);
+ color.rgb = mix(color.rgb, mask.rgb * mix(u_lightArrowColor, u_darkArrowColor, step(alphaCode, 0.6)), mask.a);
if (u_outline > 0.0)
{
- color.rgb = mix(color.rgb, vec3(1.0, 1.0, 1.0), step(kOutlineThreshold1, abs(v_halfLength)));
- color.rgb = mix(color.rgb, vec3(1.0, 1.0, 1.0), smoothstep(kOutlineThreshold2, kOutlineThreshold1, abs(v_halfLength)));
+ color.rgb = mix(color.rgb, u_outlineColor, step(kOutlineThreshold1, abs(v_halfLength)));
+ color.rgb = mix(color.rgb, u_outlineColor, smoothstep(kOutlineThreshold2, kOutlineThreshold1, abs(v_halfLength)));
}
gl_FragColor = color;
}