diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-03-16 14:09:12 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:56:29 +0300 |
commit | 2a43da39084560af0dc3903d540810cee55cdcf0 (patch) | |
tree | a4d03f09538a0285b9c30821921f330d25822ab7 /drape | |
parent | e3b7c04e441dafd92ec78301a50f687901662208 (diff) |
Fixed deformation of search marks
Diffstat (limited to 'drape')
-rw-r--r-- | drape/shaders/user_mark.vsh | 4 | ||||
-rw-r--r-- | drape/shaders/user_mark_billboard.vsh | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drape/shaders/user_mark.vsh b/drape/shaders/user_mark.vsh index 724fef0756..6c475bcfb2 100644 --- a/drape/shaders/user_mark.vsh +++ b/drape/shaders/user_mark.vsh @@ -16,7 +16,9 @@ void main(void) if (a_animate > 0.0) normal = u_interpolationT * normal; - vec4 pos = (vec4(normal, 0, 0) + vec4(a_position, 1) * modelView) * projection; + lowp vec4 p = vec4(a_position, 1) * modelView; + highp vec4 pos = vec4(normal, 0, 0) + p; + pos = pos * projection; float w = pos.w; pos.xyw = (pivotTransform * vec4(pos.xy, 0.0, w)).xyw; pos.z *= pos.w / w; diff --git a/drape/shaders/user_mark_billboard.vsh b/drape/shaders/user_mark_billboard.vsh index 4ad8aa043d..81e349c4fd 100644 --- a/drape/shaders/user_mark_billboard.vsh +++ b/drape/shaders/user_mark_billboard.vsh @@ -16,8 +16,10 @@ void main(void) if (a_animate > 0.0) normal = u_interpolationT * normal; - vec4 pivot = vec4(a_position.xyz, 1) * modelView; - vec4 offset = vec4(normal, 0, 0) * projection; + // Here we intentionally decrease precision of 'pivot' calculation + // to eliminate jittering effect in process of billboard reconstruction. + lowp vec4 pivot = vec4(a_position.xyz, 1.0) * modelView; + vec4 offset = vec4(normal, 0.0, 0.0) * projection; vec4 projectedPivot = pivot * projection; vec4 transformedPivot = pivotTransform * vec4(projectedPivot.xy, 0.0, 1.0); |