diff --git a/data/resources-6plus_clear/traffic-arrow.png b/data/resources-6plus_clear/traffic-arrow.png index ff4e41a01a..88d0e762fe 100644 Binary files a/data/resources-6plus_clear/traffic-arrow.png and b/data/resources-6plus_clear/traffic-arrow.png differ diff --git a/data/resources-6plus_dark/traffic-arrow.png b/data/resources-6plus_dark/traffic-arrow.png index ff4e41a01a..88d0e762fe 100644 Binary files a/data/resources-6plus_dark/traffic-arrow.png and b/data/resources-6plus_dark/traffic-arrow.png differ diff --git a/data/resources-6plus_legacy/traffic-arrow.png b/data/resources-6plus_legacy/traffic-arrow.png index ff4e41a01a..88d0e762fe 100644 Binary files a/data/resources-6plus_legacy/traffic-arrow.png and b/data/resources-6plus_legacy/traffic-arrow.png differ diff --git a/data/resources-hdpi_clear/traffic-arrow.png b/data/resources-hdpi_clear/traffic-arrow.png index ff4e41a01a..007700f5bf 100644 Binary files a/data/resources-hdpi_clear/traffic-arrow.png and b/data/resources-hdpi_clear/traffic-arrow.png differ diff --git a/data/resources-hdpi_dark/traffic-arrow.png b/data/resources-hdpi_dark/traffic-arrow.png index ff4e41a01a..007700f5bf 100644 Binary files a/data/resources-hdpi_dark/traffic-arrow.png and b/data/resources-hdpi_dark/traffic-arrow.png differ diff --git a/data/resources-hdpi_legacy/traffic-arrow.png b/data/resources-hdpi_legacy/traffic-arrow.png index ff4e41a01a..007700f5bf 100644 Binary files a/data/resources-hdpi_legacy/traffic-arrow.png and b/data/resources-hdpi_legacy/traffic-arrow.png differ diff --git a/data/resources-ldpi_clear/traffic-arrow.png b/data/resources-ldpi_clear/traffic-arrow.png index ff4e41a01a..e0fe1d6187 100644 Binary files a/data/resources-ldpi_clear/traffic-arrow.png and b/data/resources-ldpi_clear/traffic-arrow.png differ diff --git a/data/resources-ldpi_dark/traffic-arrow.png b/data/resources-ldpi_dark/traffic-arrow.png index ff4e41a01a..e0fe1d6187 100644 Binary files a/data/resources-ldpi_dark/traffic-arrow.png and b/data/resources-ldpi_dark/traffic-arrow.png differ diff --git a/data/resources-ldpi_legacy/traffic-arrow.png b/data/resources-ldpi_legacy/traffic-arrow.png index ff4e41a01a..e0fe1d6187 100644 Binary files a/data/resources-ldpi_legacy/traffic-arrow.png and b/data/resources-ldpi_legacy/traffic-arrow.png differ diff --git a/data/resources-mdpi_clear/traffic-arrow.png b/data/resources-mdpi_clear/traffic-arrow.png index ff4e41a01a..5b726e4858 100644 Binary files a/data/resources-mdpi_clear/traffic-arrow.png and b/data/resources-mdpi_clear/traffic-arrow.png differ diff --git a/data/resources-mdpi_dark/traffic-arrow.png b/data/resources-mdpi_dark/traffic-arrow.png index ff4e41a01a..5b726e4858 100644 Binary files a/data/resources-mdpi_dark/traffic-arrow.png and b/data/resources-mdpi_dark/traffic-arrow.png differ diff --git a/data/resources-mdpi_legacy/traffic-arrow.png b/data/resources-mdpi_legacy/traffic-arrow.png index ff4e41a01a..5b726e4858 100644 Binary files a/data/resources-mdpi_legacy/traffic-arrow.png and b/data/resources-mdpi_legacy/traffic-arrow.png differ diff --git a/data/resources-xhdpi_clear/traffic-arrow.png b/data/resources-xhdpi_clear/traffic-arrow.png index ff4e41a01a..e0c16b87da 100644 Binary files a/data/resources-xhdpi_clear/traffic-arrow.png and b/data/resources-xhdpi_clear/traffic-arrow.png differ diff --git a/data/resources-xhdpi_dark/traffic-arrow.png b/data/resources-xhdpi_dark/traffic-arrow.png index ff4e41a01a..e0c16b87da 100644 Binary files a/data/resources-xhdpi_dark/traffic-arrow.png and b/data/resources-xhdpi_dark/traffic-arrow.png differ diff --git a/data/resources-xhdpi_legacy/traffic-arrow.png b/data/resources-xhdpi_legacy/traffic-arrow.png index ff4e41a01a..e0c16b87da 100644 Binary files a/data/resources-xhdpi_legacy/traffic-arrow.png and b/data/resources-xhdpi_legacy/traffic-arrow.png differ diff --git a/data/resources-xxhdpi_clear/traffic-arrow.png b/data/resources-xxhdpi_clear/traffic-arrow.png index ff4e41a01a..b11adb2950 100644 Binary files a/data/resources-xxhdpi_clear/traffic-arrow.png and b/data/resources-xxhdpi_clear/traffic-arrow.png differ diff --git a/data/resources-xxhdpi_dark/traffic-arrow.png b/data/resources-xxhdpi_dark/traffic-arrow.png index ff4e41a01a..b11adb2950 100644 Binary files a/data/resources-xxhdpi_dark/traffic-arrow.png and b/data/resources-xxhdpi_dark/traffic-arrow.png differ diff --git a/data/resources-xxhdpi_legacy/traffic-arrow.png b/data/resources-xxhdpi_legacy/traffic-arrow.png index ff4e41a01a..b11adb2950 100644 Binary files a/data/resources-xxhdpi_legacy/traffic-arrow.png and b/data/resources-xxhdpi_legacy/traffic-arrow.png differ diff --git a/drape/shaders/traffic_fragment_shader.fsh b/drape/shaders/traffic_fragment_shader.fsh index 287ea0b076..46fb3fa247 100644 --- a/drape/shaders/traffic_fragment_shader.fsh +++ b/drape/shaders/traffic_fragment_shader.fsh @@ -8,12 +8,22 @@ uniform float u_opacity; const float kAntialiasingThreshold = 0.92; +const vec3 kLightArrow = vec3(1.0, 1.0, 1.0); +const vec3 kDarkArrow = vec3(160.0 / 255.0, 120.0 / 255.0, 30.0 / 255.0); + void main(void) { vec4 color = texture2D(u_colorTex, v_colorTexCoord); - vec4 mask = texture2D(u_maskTex, v_maskTexCoord); - color.a = color.a * u_opacity * (1.0 - smoothstep(kAntialiasingThreshold, 1.0, abs(v_halfLength))); - color.rgb = mix(color.rgb, mask.rgb, mask.a); - - gl_FragColor = color; + float alphaCode = color.a; + if (alphaCode > 0.1) + { + 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); + gl_FragColor = color; + } + else + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } } diff --git a/drape/shaders/traffic_vertex_shader.vsh b/drape/shaders/traffic_vertex_shader.vsh index d66d811df9..7625f7cc79 100644 --- a/drape/shaders/traffic_vertex_shader.vsh +++ b/drape/shaders/traffic_vertex_shader.vsh @@ -13,6 +13,7 @@ varying vec2 v_maskTexCoord; varying float v_halfLength; const float kShapeCoordScalar = 1000.0; +const float kMinVisibleArrowPart = 0.9; void main(void) { @@ -34,6 +35,7 @@ void main(void) float uOffset = length(vec4(kShapeCoordScalar, 0, 0, 0) * modelView) * a_normal.w; v_colorTexCoord = a_colorTexCoord; v_maskTexCoord = vec2(uOffset * u_trafficParams.z, 0.5 * a_normal.z + 0.5) * u_trafficParams.w; + v_maskTexCoord.x *= step(kMinVisibleArrowPart, v_maskTexCoord.x); v_halfLength = a_normal.z; vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection; float w = pos.w; diff --git a/drape_frontend/color_constants.cpp b/drape_frontend/color_constants.cpp index a3053de113..b940c297ca 100644 --- a/drape_frontend/color_constants.cpp +++ b/drape_frontend/color_constants.cpp @@ -24,12 +24,12 @@ unordered_map> kColorConstants = { TrackCarSpeed, dp::Color(21, 121, 244, 255) }, { TrackPlaneSpeed, dp::Color(10, 196, 255, 255) }, { TrackUnknownDistance, dp::Color(97, 97, 97, 255) }, - { TrafficG0, dp::Color(60, 170, 60, 255) }, - { TrafficG1, dp::Color(60, 170, 60, 255) }, - { TrafficG2, dp::Color(227, 38, 54, 255) }, - { TrafficG3, dp::Color(0, 100, 100, 255) }, - { TrafficG4, dp::Color(100, 0, 100, 255) }, - { TrafficG5, dp::Color(100, 100, 0, 255) }, + { TrafficG0, dp::Color(180, 25, 25, 255) }, + { TrafficG1, dp::Color(230, 60, 55, 255) }, + { TrafficG2, dp::Color(230, 60, 55, 255) }, + { TrafficG3, dp::Color(250, 190, 45, 127) }, + { TrafficG4, dp::Color(250, 190, 45, 127) }, + { TrafficG5, dp::Color(55, 165, 55, 255) }, { TrafficTempBlock, dp::Color(0, 0, 0, 255) }, { TrafficUnknown, dp::Color(0, 0, 0, 0) }, } @@ -48,12 +48,12 @@ unordered_map> kColorConstants = { TrackCarSpeed, dp::Color(255, 202, 40, 255) }, { TrackPlaneSpeed, dp::Color(255, 245, 160, 255) }, { TrackUnknownDistance, dp::Color(150, 150, 150, 255) }, - { TrafficG0, dp::Color(60, 170, 60, 255) }, - { TrafficG1, dp::Color(60, 170, 60, 255) }, - { TrafficG2, dp::Color(227, 38, 54, 255) }, - { TrafficG3, dp::Color(100, 100, 100, 255) }, - { TrafficG4, dp::Color(100, 100, 100, 255) }, - { TrafficG5, dp::Color(100, 100, 100, 255) }, + { TrafficG0, dp::Color(180, 25, 25, 255) }, + { TrafficG1, dp::Color(230, 60, 55, 255) }, + { TrafficG2, dp::Color(230, 60, 55, 255) }, + { TrafficG3, dp::Color(250, 190, 45, 127) }, + { TrafficG4, dp::Color(250, 190, 45, 127) }, + { TrafficG5, dp::Color(55, 165, 55, 255) }, { TrafficTempBlock, dp::Color(0, 0, 0, 255) }, { TrafficUnknown, dp::Color(0, 0, 0, 0) }, } diff --git a/drape_frontend/traffic_renderer.cpp b/drape_frontend/traffic_renderer.cpp index c8d1d9906b..8444aab29d 100644 --- a/drape_frontend/traffic_renderer.cpp +++ b/drape_frontend/traffic_renderer.cpp @@ -22,7 +22,7 @@ namespace int const kMinVisibleZoomLevel = 10; int const kMinVisibleArrowZoomLevel = 16; -float const kTrafficArrowAspect = 64.0f / 16.0f; +float const kTrafficArrowAspect = 24.0f / 8.0f; float const kLeftWidthInPixel[] = {