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-23 13:26:35 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-11-23 13:30:47 +0300
commitb1b87d7561e1870b38c91853cab7cbdc218548c7 (patch)
tree77c8bce500c35e750a8ba735cc731ba906b40fdd /drape
parent7a58e9f450e8aebedc0f04618a8ce5820d18191d (diff)
Review fixes
Diffstat (limited to 'drape')
-rw-r--r--drape/shaders/traffic_fragment_shader.fsh9
1 files changed, 9 insertions, 0 deletions
diff --git a/drape/shaders/traffic_fragment_shader.fsh b/drape/shaders/traffic_fragment_shader.fsh
index e7d10f0e9d..f432f86b62 100644
--- a/drape/shaders/traffic_fragment_shader.fsh
+++ b/drape/shaders/traffic_fragment_shader.fsh
@@ -5,9 +5,13 @@ varying float v_halfLength;
uniform sampler2D u_colorTex;
uniform sampler2D u_maskTex;
uniform float u_opacity;
+uniform float u_outline;
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);
@@ -20,6 +24,11 @@ void main(void)
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);
+ 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)));
+ }
gl_FragColor = color;
}
else