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-09-01 18:13:15 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-09-02 16:40:15 +0300
commitfeda627f30fd97b62f904c43ca3c8f3f1e608ca0 (patch)
tree8dcc86ab477a17a74dd4014158c3d3dc8429c489 /drape
parent4737649abe7a822453999dafa3563a5423833b84 (diff)
Added tile-based model-view
Diffstat (limited to 'drape')
-rw-r--r--drape/glsl_types.hpp5
-rw-r--r--drape/shaders/arrow3d_shadow_vertex_shader.vsh4
-rw-r--r--drape/shaders/arrow3d_vertex_shader.vsh4
-rw-r--r--drape/shaders/circle_shader.vsh4
-rw-r--r--drape/shaders/dashed_vertex_shader.vsh4
-rw-r--r--drape/shaders/masked_texturing_vertex_shader.vsh6
-rw-r--r--drape/shaders/my_position_shader.vsh6
-rw-r--r--drape/shaders/path_symbol_vertex_shader.vsh6
-rwxr-xr-xdrape/shaders/text_outlined_gui_vertex_shader.vsh6
-rwxr-xr-xdrape/shaders/text_outlined_vertex_shader.vsh6
-rw-r--r--drape/shaders/text_vertex_shader.vsh6
-rw-r--r--drape/shaders/texturing_vertex_shader.vsh6
-rw-r--r--drape/shaders/trackpoint_vertex_shader.vsh7
13 files changed, 32 insertions, 38 deletions
diff --git a/drape/glsl_types.hpp b/drape/glsl_types.hpp
index 48f3a27092..7831e2d45b 100644
--- a/drape/glsl_types.hpp
+++ b/drape/glsl_types.hpp
@@ -56,6 +56,11 @@ inline vec2 ToVec2(m2::PointD const & pt)
return glsl::vec2(pt.x, pt.y);
}
+inline m2::PointD FromVec2(glsl::vec2 const & pt)
+{
+ return m2::PointD(pt.x, pt.y);
+}
+
inline vec4 ToVec4(dp::Color const & color)
{
return glsl::vec4(double(color.GetRed()) / 255,
diff --git a/drape/shaders/arrow3d_shadow_vertex_shader.vsh b/drape/shaders/arrow3d_shadow_vertex_shader.vsh
index a46afd5dc6..1eb3664869 100644
--- a/drape/shaders/arrow3d_shadow_vertex_shader.vsh
+++ b/drape/shaders/arrow3d_shadow_vertex_shader.vsh
@@ -1,12 +1,12 @@
attribute vec4 a_pos;
-uniform mat4 m_transform;
+uniform mat4 u_transform;
varying float v_intensity;
void main()
{
- vec4 position = m_transform * vec4(a_pos.x, a_pos.y, 0.0, 1.0);
+ vec4 position = u_transform * vec4(a_pos.x, a_pos.y, 0.0, 1.0);
v_intensity = a_pos.w;
gl_Position = position;
}
diff --git a/drape/shaders/arrow3d_vertex_shader.vsh b/drape/shaders/arrow3d_vertex_shader.vsh
index ddd1063394..8e6e2194ce 100644
--- a/drape/shaders/arrow3d_vertex_shader.vsh
+++ b/drape/shaders/arrow3d_vertex_shader.vsh
@@ -1,7 +1,7 @@
attribute vec4 a_pos;
attribute vec3 a_normal;
-uniform mat4 m_transform;
+uniform mat4 u_transform;
varying vec2 v_intensity;
@@ -9,7 +9,7 @@ const vec3 lightDir = vec3(0.316, 0.0, 0.948);
void main()
{
- vec4 position = m_transform * vec4(a_pos.xyz, 1.0);
+ vec4 position = u_transform * vec4(a_pos.xyz, 1.0);
v_intensity = vec2(max(0.0, -dot(lightDir, a_normal)), a_pos.w);
gl_Position = position;
}
diff --git a/drape/shaders/circle_shader.vsh b/drape/shaders/circle_shader.vsh
index 8c26ea861c..84fc8029fe 100644
--- a/drape/shaders/circle_shader.vsh
+++ b/drape/shaders/circle_shader.vsh
@@ -16,8 +16,8 @@ varying vec2 v_colorTexCoords;
void main(void)
{
- lowp vec4 p = vec4(a_position, 1) * modelView;
- highp vec4 pos = vec4(a_normal.xy, 0, 0) + p;
+ vec4 p = vec4(a_position, 1) * modelView;
+ vec4 pos = vec4(a_normal.xy, 0, 0) + p;
pos = pos * projection;
float w = pos.w;
diff --git a/drape/shaders/dashed_vertex_shader.vsh b/drape/shaders/dashed_vertex_shader.vsh
index 5704469871..63455bbcae 100644
--- a/drape/shaders/dashed_vertex_shader.vsh
+++ b/drape/shaders/dashed_vertex_shader.vsh
@@ -11,6 +11,8 @@ varying vec2 v_colorTexCoord;
varying vec2 v_maskTexCoord;
varying vec2 v_halfLength;
+const float kShapeCoordScalar = 1000.0;
+
void main(void)
{
vec2 normal = a_normal.xy;
@@ -23,7 +25,7 @@ void main(void)
transformedAxisPos = transformedAxisPos + normalize(shiftPos - transformedAxisPos) * halfWidth;
}
- float uOffset = min(length(vec4(1, 0, 0, 0) * modelView) * a_maskTexCoord.x, 1.0);
+ float uOffset = min(length(vec4(kShapeCoordScalar, 0, 0, 0) * modelView) * a_maskTexCoord.x, 1.0);
v_colorTexCoord = a_colorTexCoord;
v_maskTexCoord = vec2(a_maskTexCoord.y + uOffset * a_maskTexCoord.z, a_maskTexCoord.w);
v_halfLength = vec2(sign(a_normal.z) * halfWidth, abs(a_normal.z));
diff --git a/drape/shaders/masked_texturing_vertex_shader.vsh b/drape/shaders/masked_texturing_vertex_shader.vsh
index 66f03e7077..4b6a261ed8 100644
--- a/drape/shaders/masked_texturing_vertex_shader.vsh
+++ b/drape/shaders/masked_texturing_vertex_shader.vsh
@@ -12,10 +12,8 @@ varying vec2 v_maskTexCoords;
void main(void)
{
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = vec4(a_position.xyz, 1) * modelView;
- highp vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
+ vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
diff --git a/drape/shaders/my_position_shader.vsh b/drape/shaders/my_position_shader.vsh
index eabd2537f0..d6653f75d9 100644
--- a/drape/shaders/my_position_shader.vsh
+++ b/drape/shaders/my_position_shader.vsh
@@ -21,9 +21,9 @@ void main(void)
rotation[2] = vec4(0.0, 0.0, 1.0, 0.0);
rotation[3] = vec4(0.0, 0.0, 0.0, 1.0);
- lowp vec4 pos = vec4(u_position, 1.0) * modelView;
- highp vec4 normal = vec4(a_normal, 0, 0);
- highp vec4 shiftedPos = normal * rotation + pos;
+ vec4 pos = vec4(u_position, 1.0) * modelView;
+ vec4 normal = vec4(a_normal, 0, 0);
+ vec4 shiftedPos = normal * rotation + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
diff --git a/drape/shaders/path_symbol_vertex_shader.vsh b/drape/shaders/path_symbol_vertex_shader.vsh
index 38c6b7791a..0cfc4e6d44 100644
--- a/drape/shaders/path_symbol_vertex_shader.vsh
+++ b/drape/shaders/path_symbol_vertex_shader.vsh
@@ -10,9 +10,9 @@ varying vec2 v_colorTexCoords;
void main(void)
{
- lowp vec4 pos = vec4(a_position.xyz, 1) * modelView;
- highp vec4 norm = vec4(a_normal, 0, 0) * modelView;
- highp vec4 shiftedPos = norm + pos;
+ vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 norm = vec4(a_normal, 0, 0) * modelView;
+ vec4 shiftedPos = norm + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
diff --git a/drape/shaders/text_outlined_gui_vertex_shader.vsh b/drape/shaders/text_outlined_gui_vertex_shader.vsh
index 6a60995631..d789392d11 100755
--- a/drape/shaders/text_outlined_gui_vertex_shader.vsh
+++ b/drape/shaders/text_outlined_gui_vertex_shader.vsh
@@ -27,10 +27,8 @@ void main()
float notOutline = One - isOutline;
float depthShift = BaseDepthShift * isOutline;
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = (vec4(a_position.xyz, 1.0) + vec4(Zero, Zero, depthShift, Zero)) * modelView;
- highp vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
+ vec4 pos = (vec4(a_position.xyz, 1.0) + vec4(Zero, Zero, depthShift, Zero)) * modelView;
+ vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
gl_Position = shiftedPos * projection;
vec2 colorTexCoord = a_colorTexCoord * notOutline + a_outlineColorTexCoord * isOutline;
#ifdef ENABLE_VTF
diff --git a/drape/shaders/text_outlined_vertex_shader.vsh b/drape/shaders/text_outlined_vertex_shader.vsh
index 977a3de444..2631954ce2 100755
--- a/drape/shaders/text_outlined_vertex_shader.vsh
+++ b/drape/shaders/text_outlined_vertex_shader.vsh
@@ -28,10 +28,8 @@ void main()
float notOutline = One - isOutline;
float depthShift = BaseDepthShift * isOutline;
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = (vec4(a_position.xyz, 1) + vec4(Zero, Zero, depthShift, Zero)) * modelView;
- highp vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
+ vec4 pos = (vec4(a_position.xyz, 1) + vec4(Zero, Zero, depthShift, Zero)) * modelView;
+ vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
diff --git a/drape/shaders/text_vertex_shader.vsh b/drape/shaders/text_vertex_shader.vsh
index e7be2fd7eb..dd11320841 100644
--- a/drape/shaders/text_vertex_shader.vsh
+++ b/drape/shaders/text_vertex_shader.vsh
@@ -22,10 +22,8 @@ const float One = 1.0;
void main()
{
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = vec4(a_position.xyz, 1) * modelView;
- highp vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
+ vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 shiftedPos = vec4(a_normal, Zero, Zero) + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
diff --git a/drape/shaders/texturing_vertex_shader.vsh b/drape/shaders/texturing_vertex_shader.vsh
index d633a12540..fd05958500 100644
--- a/drape/shaders/texturing_vertex_shader.vsh
+++ b/drape/shaders/texturing_vertex_shader.vsh
@@ -10,10 +10,8 @@ varying vec2 v_colorTexCoords;
void main(void)
{
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = vec4(a_position.xyz, 1) * modelView;
- highp vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
+ vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
shiftedPos = shiftedPos * projection;
float w = shiftedPos.w;
shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
diff --git a/drape/shaders/trackpoint_vertex_shader.vsh b/drape/shaders/trackpoint_vertex_shader.vsh
index 1997cea791..4c87712fc2 100644
--- a/drape/shaders/trackpoint_vertex_shader.vsh
+++ b/drape/shaders/trackpoint_vertex_shader.vsh
@@ -17,11 +17,8 @@ varying vec4 v_color;
void main(void)
{
vec3 radius = a_normal * a_position.z;
-
- // Here we intentionally decrease precision of 'pos' calculation
- // to eliminate jittering effect in process of billboard reconstruction.
- lowp vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
- highp vec4 shiftedPos = vec4(radius.xy, 0, 0) + pos;
+ vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
+ vec4 shiftedPos = vec4(radius.xy, 0, 0) + pos;
vec4 finalPos = shiftedPos * projection;
float w = finalPos.w;
finalPos.xyw = (pivotTransform * vec4(finalPos.xy, 0.0, w)).xyw;