Fixed deformation of search marks

This commit is contained in:
r.kuznetsov 2016-03-16 14:09:12 +03:00 committed by Sergey Yershov
parent e3b7c04e44
commit 2a43da3908
2 changed files with 7 additions and 3 deletions

View file

@ -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;

View file

@ -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);