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
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-06-27 14:31:28 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-06-28 18:04:46 +0300
commit68f4e87b2cd1ab60484d2802f6a4da6bb56a07a2 (patch)
tree5a6c36c3cb879e547a3e62f5d84148b6644ff149 /shaders
parent21860e225b3956094091da8460a0a71f0b008e96 (diff)
Updated shaders
Diffstat (limited to 'shaders')
-rw-r--r--shaders/GL/area.vsh.glsl12
-rw-r--r--shaders/GL/area3d.vsh.glsl22
-rw-r--r--shaders/GL/area3d_outline.vsh.glsl18
-rw-r--r--shaders/GL/circle.fsh.glsl6
-rw-r--r--shaders/GL/circle.vsh.glsl12
-rw-r--r--shaders/GL/circle_point.vsh.glsl10
-rw-r--r--shaders/GL/colored_symbol.fsh.glsl8
-rw-r--r--shaders/GL/colored_symbol.vsh.glsl12
-rw-r--r--shaders/GL/colored_symbol_billboard.vsh.glsl14
-rw-r--r--shaders/GL/dashed_line.vsh.glsl16
-rw-r--r--shaders/GL/hatching_area.fsh.glsl6
-rw-r--r--shaders/GL/hatching_area.vsh.glsl12
-rw-r--r--shaders/GL/line.fsh.glsl6
-rw-r--r--shaders/GL/line.vsh.glsl16
-rw-r--r--shaders/GL/masked_texturing.vsh.glsl10
-rw-r--r--shaders/GL/masked_texturing_billboard.vsh.glsl16
-rw-r--r--shaders/GL/my_position.vsh.glsl10
-rw-r--r--shaders/GL/path_symbol.vsh.glsl12
-rw-r--r--shaders/GL/position_accuracy3d.vsh.glsl14
-rw-r--r--shaders/GL/route.vsh.glsl14
-rw-r--r--shaders/GL/route_arrow.vsh.glsl14
-rw-r--r--shaders/GL/route_marker.fsh.glsl2
-rw-r--r--shaders/GL/route_marker.vsh.glsl14
-rw-r--r--shaders/GL/ruler.vsh.glsl4
-rw-r--r--shaders/GL/shader_index.txt94
-rw-r--r--shaders/GL/shaders_lib.glsl2
-rw-r--r--shaders/GL/solid_color.fsh.glsl6
-rwxr-xr-xshaders/GL/text.fsh.glsl6
-rw-r--r--shaders/GL/text.vsh.glsl12
-rwxr-xr-xshaders/GL/text_billboard.vsh.glsl18
-rwxr-xr-xshaders/GL/text_fixed.fsh.glsl6
-rwxr-xr-xshaders/GL/text_outlined.vsh.glsl12
-rwxr-xr-xshaders/GL/text_outlined_billboard.vsh.glsl17
-rwxr-xr-xshaders/GL/text_outlined_gui.vsh.glsl10
-rw-r--r--shaders/GL/texturing.vsh.glsl10
-rw-r--r--shaders/GL/texturing_billboard.vsh.glsl16
-rw-r--r--shaders/GL/texturing_gui.vsh.glsl6
-rw-r--r--shaders/GL/traffic.vsh.glsl16
-rw-r--r--shaders/GL/traffic_line.vsh.glsl12
-rw-r--r--shaders/GL/transit.vsh.glsl14
-rw-r--r--shaders/GL/transit_marker.vsh.glsl12
-rw-r--r--shaders/GL/user_mark.vsh.glsl16
-rw-r--r--shaders/GL/user_mark_billboard.vsh.glsl18
43 files changed, 292 insertions, 291 deletions
diff --git a/shaders/GL/area.vsh.glsl b/shaders/GL/area.vsh.glsl
index 50032778bb..fd47ba1ef0 100644
--- a/shaders/GL/area.vsh.glsl
+++ b/shaders/GL/area.vsh.glsl
@@ -1,21 +1,21 @@
attribute vec3 a_position;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
void main()
{
- vec4 pos = vec4(a_position, 1) * modelView * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(a_position, 1) * u_modelView * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords);
#else
diff --git a/shaders/GL/area3d.vsh.glsl b/shaders/GL/area3d.vsh.glsl
index b579d0ed2e..d3f372954d 100644
--- a/shaders/GL/area3d.vsh.glsl
+++ b/shaders/GL/area3d.vsh.glsl
@@ -2,10 +2,10 @@ attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float zScale;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_zScale;
varying vec2 v_colorTexCoords;
varying float v_intensity;
@@ -14,14 +14,14 @@ const vec4 kNormalizedLightDir = vec4(0.3162, 0.0, 0.9486, 0.0);
void main()
{
- vec4 pos = vec4(a_position, 1.0) * modelView;
+ vec4 pos = vec4(a_position, 1.0) * u_modelView;
- vec4 normal = vec4(a_position + a_normal, 1.0) * modelView;
- normal.xyw = (normal * projection).xyw;
- normal.z = normal.z * zScale;
+ vec4 normal = vec4(a_position + a_normal, 1.0) * u_modelView;
+ normal.xyw = (normal * u_projection).xyw;
+ normal.z = normal.z * u_zScale;
- pos.xyw = (pos * projection).xyw;
- pos.z = a_position.z * zScale;
+ pos.xyw = (pos * u_projection).xyw;
+ pos.z = a_position.z * u_zScale;
vec4 normDir = normal - pos;
if (dot(normDir, normDir) != 0.0)
@@ -29,6 +29,6 @@ void main()
else
v_intensity = 0.0;
- gl_Position = pivotTransform * pos;
+ gl_Position = u_pivotTransform * pos;
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/area3d_outline.vsh.glsl b/shaders/GL/area3d_outline.vsh.glsl
index a5f5469e60..118910a426 100644
--- a/shaders/GL/area3d_outline.vsh.glsl
+++ b/shaders/GL/area3d_outline.vsh.glsl
@@ -1,24 +1,24 @@
attribute vec3 a_position;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float zScale;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_zScale;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
void main()
{
- vec4 pos = vec4(a_position, 1.0) * modelView;
- pos.xyw = (pos * projection).xyw;
- pos.z = a_position.z * zScale;
- gl_Position = pivotTransform * pos;
+ vec4 pos = vec4(a_position, 1.0) * u_modelView;
+ pos.xyw = (pos * u_projection).xyw;
+ pos.z = a_position.z * u_zScale;
+ gl_Position = u_pivotTransform * pos;
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords);
diff --git a/shaders/GL/circle.fsh.glsl b/shaders/GL/circle.fsh.glsl
index 30165a0a72..e81ece0678 100644
--- a/shaders/GL/circle.fsh.glsl
+++ b/shaders/GL/circle.fsh.glsl
@@ -1,6 +1,6 @@
uniform float u_opacity;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
uniform sampler2D u_colorTex;
varying vec2 v_colorTexCoords;
@@ -13,9 +13,9 @@ const float aaPixelsCount = 2.5;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 finalColor = v_color;
+ LOW_P vec4 finalColor = v_color;
#else
- lowp vec4 finalColor = texture2D(u_colorTex, v_colorTexCoords);
+ LOW_P vec4 finalColor = texture2D(u_colorTex, v_colorTexCoords);
#endif
float smallRadius = v_radius.z - aaPixelsCount;
diff --git a/shaders/GL/circle.vsh.glsl b/shaders/GL/circle.vsh.glsl
index e7824a6954..e4007d2426 100644
--- a/shaders/GL/circle.vsh.glsl
+++ b/shaders/GL/circle.vsh.glsl
@@ -2,23 +2,23 @@ attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec3 v_radius;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
void main()
{
- vec4 p = vec4(a_position, 1) * modelView;
+ vec4 p = vec4(a_position, 1) * u_modelView;
vec4 pos = vec4(a_normal.xy, 0, 0) + p;
- gl_Position = applyPivotTransform(pos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(pos * u_projection, u_pivotTransform, 0.0);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords);
#else
diff --git a/shaders/GL/circle_point.vsh.glsl b/shaders/GL/circle_point.vsh.glsl
index 7d658bc5ed..ca165c806b 100644
--- a/shaders/GL/circle_point.vsh.glsl
+++ b/shaders/GL/circle_point.vsh.glsl
@@ -2,9 +2,9 @@ attribute vec3 a_normal;
attribute vec3 a_position;
attribute vec4 a_color;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec3 v_radius;
varying vec4 v_color;
@@ -12,9 +12,9 @@ varying vec4 v_color;
void main()
{
vec3 radius = a_normal * a_position.z;
- vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
+ vec4 pos = vec4(a_position.xy, 0, 1) * u_modelView;
vec4 shiftedPos = vec4(radius.xy, 0, 0) + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
v_radius = radius;
v_color = a_color;
diff --git a/shaders/GL/colored_symbol.fsh.glsl b/shaders/GL/colored_symbol.fsh.glsl
index 3626c500c6..4329d213e2 100644
--- a/shaders/GL/colored_symbol.fsh.glsl
+++ b/shaders/GL/colored_symbol.fsh.glsl
@@ -2,7 +2,7 @@ uniform float u_opacity;
varying vec4 v_normal;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
uniform sampler2D u_colorTex;
varying vec2 v_colorTexCoords;
@@ -13,9 +13,9 @@ const float aaPixelsCount = 2.5;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 color = v_color;
+ LOW_P vec4 color = v_color;
#else
- lowp vec4 color = texture2D(u_colorTex, v_colorTexCoords);
+ LOW_P vec4 color = texture2D(u_colorTex, v_colorTexCoords);
#endif
float r1 = (v_normal.z - aaPixelsCount) * (v_normal.z - aaPixelsCount);
@@ -23,7 +23,7 @@ void main()
float r3 = v_normal.z * v_normal.z;
float alpha = mix(step(r3, r2), smoothstep(r1, r3, r2), v_normal.w);
- lowp vec4 finalColor = color;
+ LOW_P vec4 finalColor = color;
finalColor.a = finalColor.a * u_opacity * (1.0 - alpha);
if (finalColor.a == 0.0)
discard;
diff --git a/shaders/GL/colored_symbol.vsh.glsl b/shaders/GL/colored_symbol.vsh.glsl
index e6a0a6825c..1d75acf942 100644
--- a/shaders/GL/colored_symbol.vsh.glsl
+++ b/shaders/GL/colored_symbol.vsh.glsl
@@ -2,23 +2,23 @@ attribute vec3 a_position;
attribute vec4 a_normal;
attribute vec4 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec4 v_normal;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
void main()
{
- vec4 p = vec4(a_position, 1) * modelView;
+ vec4 p = vec4(a_position, 1) * u_modelView;
vec4 pos = vec4(a_normal.xy + a_colorTexCoords.zw, 0, 0) + p;
- gl_Position = applyPivotTransform(pos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(pos * u_projection, u_pivotTransform, 0.0);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords.xy);
diff --git a/shaders/GL/colored_symbol_billboard.vsh.glsl b/shaders/GL/colored_symbol_billboard.vsh.glsl
index 3d3ac8ef90..f521d272da 100644
--- a/shaders/GL/colored_symbol_billboard.vsh.glsl
+++ b/shaders/GL/colored_symbol_billboard.vsh.glsl
@@ -2,23 +2,23 @@ attribute vec3 a_position;
attribute vec4 a_normal;
attribute vec4 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec4 v_normal;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
void main()
{
- vec4 pivot = vec4(a_position.xyz, 1.0) * modelView;
- vec4 offset = vec4(a_normal.xy + a_colorTexCoords.zw, 0.0, 0.0) * projection;
- gl_Position = applyBillboardPivotTransform(pivot * projection, pivotTransform, 0.0, offset.xy);
+ vec4 pivot = vec4(a_position.xyz, 1.0) * u_modelView;
+ vec4 offset = vec4(a_normal.xy + a_colorTexCoords.zw, 0.0, 0.0) * u_projection;
+ gl_Position = applyBillboardPivotTransform(pivot * u_projection, u_pivotTransform, 0.0, offset.xy);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords.xy);
diff --git a/shaders/GL/dashed_line.vsh.glsl b/shaders/GL/dashed_line.vsh.glsl
index 88f27cc17d..e811d10789 100644
--- a/shaders/GL/dashed_line.vsh.glsl
+++ b/shaders/GL/dashed_line.vsh.glsl
@@ -3,9 +3,9 @@ attribute vec3 a_normal;
attribute vec2 a_colorTexCoord;
attribute vec4 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoord;
varying vec2 v_maskTexCoord;
@@ -15,18 +15,18 @@ void main()
{
vec2 normal = a_normal.xy;
float halfWidth = length(normal);
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
if (halfWidth != 0.0)
{
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + normal,
- modelView, halfWidth);
+ u_modelView, halfWidth);
}
- float uOffset = min(length(vec4(kShapeCoordScalar, 0, 0, 0) * modelView) * a_maskTexCoord.x, 1.0);
+ float uOffset = min(length(vec4(kShapeCoordScalar, 0, 0, 0) * u_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));
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/hatching_area.fsh.glsl b/shaders/GL/hatching_area.fsh.glsl
index 2b56351eb0..3cc7e5867d 100644
--- a/shaders/GL/hatching_area.fsh.glsl
+++ b/shaders/GL/hatching_area.fsh.glsl
@@ -1,7 +1,7 @@
uniform float u_opacity;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
uniform sampler2D u_colorTex;
varying vec2 v_colorTexCoords;
@@ -13,9 +13,9 @@ varying vec2 v_maskTexCoords;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 color = v_color;
+ LOW_P vec4 color = v_color;
#else
- lowp vec4 color = texture2D(u_colorTex, v_colorTexCoords);
+ LOW_P vec4 color = texture2D(u_colorTex, v_colorTexCoords);
#endif
color *= texture2D(u_maskTex, v_maskTexCoords);
color.a *= u_opacity;
diff --git a/shaders/GL/hatching_area.vsh.glsl b/shaders/GL/hatching_area.vsh.glsl
index 571bb709bc..9b5407ad5a 100644
--- a/shaders/GL/hatching_area.vsh.glsl
+++ b/shaders/GL/hatching_area.vsh.glsl
@@ -2,13 +2,13 @@ attribute vec3 a_position;
attribute vec2 a_colorTexCoords;
attribute vec2 a_maskTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoords;
#endif
@@ -16,8 +16,8 @@ varying vec2 v_maskTexCoords;
void main()
{
- vec4 pos = vec4(a_position, 1) * modelView * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(a_position, 1) * u_modelView * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoords);
#else
diff --git a/shaders/GL/line.fsh.glsl b/shaders/GL/line.fsh.glsl
index 19e487c76f..ea7f8cd24f 100644
--- a/shaders/GL/line.fsh.glsl
+++ b/shaders/GL/line.fsh.glsl
@@ -2,7 +2,7 @@ varying vec2 v_halfLength;
uniform float u_opacity;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
uniform sampler2D u_colorTex;
varying vec2 v_colorTexCoord;
@@ -13,9 +13,9 @@ const float aaPixelsCount = 2.5;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 color = v_color;
+ LOW_P vec4 color = v_color;
#else
- lowp vec4 color = texture2D(u_colorTex, v_colorTexCoord);
+ LOW_P vec4 color = texture2D(u_colorTex, v_colorTexCoord);
#endif
color.a *= u_opacity;
diff --git a/shaders/GL/line.vsh.glsl b/shaders/GL/line.vsh.glsl
index 69fb458935..021fec838a 100644
--- a/shaders/GL/line.vsh.glsl
+++ b/shaders/GL/line.vsh.glsl
@@ -2,13 +2,13 @@ attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_colorTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -19,11 +19,11 @@ void main()
{
vec2 normal = a_normal.xy;
float halfWidth = length(normal);
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
if (halfWidth != 0.0)
{
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + normal,
- modelView, halfWidth);
+ u_modelView, halfWidth);
}
#ifdef ENABLE_VTF
@@ -32,6 +32,6 @@ void main()
v_colorTexCoord = a_colorTexCoord;
#endif
v_halfLength = vec2(sign(a_normal.z) * halfWidth, abs(a_normal.z));
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/masked_texturing.vsh.glsl b/shaders/GL/masked_texturing.vsh.glsl
index fc76983427..f39284265c 100644
--- a/shaders/GL/masked_texturing.vsh.glsl
+++ b/shaders/GL/masked_texturing.vsh.glsl
@@ -3,18 +3,18 @@ attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
attribute vec2 a_maskTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoords;
varying vec2 v_maskTexCoords;
void main()
{
- vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 pos = vec4(a_position.xyz, 1) * u_modelView;
vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
v_colorTexCoords = a_colorTexCoords;
v_maskTexCoords = a_maskTexCoords;
}
diff --git a/shaders/GL/masked_texturing_billboard.vsh.glsl b/shaders/GL/masked_texturing_billboard.vsh.glsl
index 68ba66f77c..8363abafc9 100644
--- a/shaders/GL/masked_texturing_billboard.vsh.glsl
+++ b/shaders/GL/masked_texturing_billboard.vsh.glsl
@@ -3,20 +3,20 @@ attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
attribute vec2 a_maskTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float zScale;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_zScale;
varying vec2 v_colorTexCoords;
varying vec2 v_maskTexCoords;
void main()
{
- vec4 pivot = vec4(a_position.xyz, 1.0) * modelView;
- vec4 offset = vec4(a_normal, 0.0, 0.0) * projection;
- gl_Position = applyBillboardPivotTransform(pivot * projection, pivotTransform, a_position.w * zScale, offset.xy);
-
+ vec4 pivot = vec4(a_position.xyz, 1.0) * u_modelView;
+ vec4 offset = vec4(a_normal, 0.0, 0.0) * u_projection;
+ gl_Position = applyBillboardPivotTransform(pivot * u_projection, u_pivotTransform,
+ a_position.w * u_zScale, offset.xy);
v_colorTexCoords = a_colorTexCoords;
v_maskTexCoords = a_maskTexCoords;
}
diff --git a/shaders/GL/my_position.vsh.glsl b/shaders/GL/my_position.vsh.glsl
index c57a957b48..73bdc2ba15 100644
--- a/shaders/GL/my_position.vsh.glsl
+++ b/shaders/GL/my_position.vsh.glsl
@@ -4,9 +4,9 @@ attribute vec2 a_colorTexCoords;
uniform vec3 u_position;
uniform float u_azimut;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoords;
@@ -21,10 +21,10 @@ void main()
rotation[2] = vec4(0.0, 0.0, 1.0, 0.0);
rotation[3] = vec4(0.0, 0.0, 0.0, 1.0);
- vec4 pos = vec4(u_position, 1.0) * modelView;
+ vec4 pos = vec4(u_position, 1.0) * u_modelView;
vec4 normal = vec4(a_normal, 0, 0);
vec4 shiftedPos = normal * rotation + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/path_symbol.vsh.glsl b/shaders/GL/path_symbol.vsh.glsl
index 0652c5cc12..708a4edc04 100644
--- a/shaders/GL/path_symbol.vsh.glsl
+++ b/shaders/GL/path_symbol.vsh.glsl
@@ -2,23 +2,23 @@ attribute vec4 a_position;
attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoords;
void main()
{
- vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 pos = vec4(a_position.xyz, 1) * u_modelView;
float normalLen = length(a_normal);
- vec4 n = vec4(a_position.xy + a_normal * kShapeCoordScalar, 0.0, 0.0) * modelView;
+ vec4 n = vec4(a_position.xy + a_normal * kShapeCoordScalar, 0.0, 0.0) * u_modelView;
vec4 norm = vec4(0.0, 0.0, 0.0, 0.0);
if (dot(n, n) != 0.0)
norm = normalize(n) * normalLen;
vec4 shiftedPos = norm + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/position_accuracy3d.vsh.glsl b/shaders/GL/position_accuracy3d.vsh.glsl
index 16c07d2c56..d5e7ec7ae7 100644
--- a/shaders/GL/position_accuracy3d.vsh.glsl
+++ b/shaders/GL/position_accuracy3d.vsh.glsl
@@ -4,21 +4,21 @@ attribute vec2 a_colorTexCoords;
uniform vec3 u_position;
uniform float u_accuracy;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float zScale;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_zScale;
varying vec2 v_colorTexCoords;
void main()
{
- vec4 position = vec4(u_position.xy, 0.0, 1.0) * modelView;
+ vec4 position = vec4(u_position.xy, 0.0, 1.0) * u_modelView;
vec4 normal = vec4(0.0, 0.0, 0.0, 0.0);
if (dot(a_normal, a_normal) != 0.0)
normal = vec4(normalize(a_normal) * u_accuracy, 0.0, 0.0);
- position = (position + normal) * projection;
- gl_Position = applyPivotTransform(position, pivotTransform, u_position.z * zScale);
+ position = (position + normal) * u_projection;
+ gl_Position = applyPivotTransform(position, u_pivotTransform, u_position.z * u_zScale);
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/route.vsh.glsl b/shaders/GL/route.vsh.glsl
index c84565d76c..588000cab5 100644
--- a/shaders/GL/route.vsh.glsl
+++ b/shaders/GL/route.vsh.glsl
@@ -3,9 +3,9 @@ attribute vec2 a_normal;
attribute vec3 a_length;
attribute vec4 a_color;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform vec4 u_routeParams;
@@ -14,19 +14,19 @@ varying vec4 v_color;
void main()
{
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
vec2 len = vec2(a_length.x, a_length.z);
if (dot(a_normal, a_normal) != 0.0)
{
vec2 norm = a_normal * u_routeParams.x;
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + norm,
- modelView, length(norm));
+ u_modelView, length(norm));
if (u_routeParams.y != 0.0)
len = vec2(a_length.x + a_length.y * u_routeParams.y, a_length.z);
}
v_length = vec3(len, u_routeParams.z);
v_color = a_color;
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/route_arrow.vsh.glsl b/shaders/GL/route_arrow.vsh.glsl
index f2591bf8ce..31220de914 100644
--- a/shaders/GL/route_arrow.vsh.glsl
+++ b/shaders/GL/route_arrow.vsh.glsl
@@ -2,9 +2,9 @@ attribute vec4 a_position;
attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform float u_arrowHalfWidth;
@@ -12,16 +12,16 @@ varying vec2 v_colorTexCoords;
void main()
{
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
if (dot(a_normal, a_normal) != 0.0)
{
vec2 norm = a_normal * u_arrowHalfWidth;
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + norm,
- modelView, length(norm));
+ u_modelView, length(norm));
}
v_colorTexCoords = a_colorTexCoords;
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/route_marker.fsh.glsl b/shaders/GL/route_marker.fsh.glsl
index 0d5bb799f0..6b2f3f0f30 100644
--- a/shaders/GL/route_marker.fsh.glsl
+++ b/shaders/GL/route_marker.fsh.glsl
@@ -6,7 +6,7 @@
uniform sampler2D u_colorTex;
#endif
-uniform vec2 u_routeParams;
+uniform vec4 u_routeParams;
uniform vec4 u_maskColor;
uniform float u_opacity;
diff --git a/shaders/GL/route_marker.vsh.glsl b/shaders/GL/route_marker.vsh.glsl
index aacc171260..5337255100 100644
--- a/shaders/GL/route_marker.vsh.glsl
+++ b/shaders/GL/route_marker.vsh.glsl
@@ -2,12 +2,12 @@ attribute vec4 a_position;
attribute vec3 a_normal;
attribute vec4 a_color;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform vec2 u_angleCosSin;
-uniform vec2 u_routeParams;
+uniform vec4 u_routeParams;
varying vec4 v_radius;
varying vec4 v_color;
@@ -18,10 +18,10 @@ void main()
vec2 normal = vec2(a_normal.x * u_angleCosSin.x - a_normal.y * u_angleCosSin.y,
a_normal.x * u_angleCosSin.y + a_normal.y * u_angleCosSin.x);
vec4 radius = vec4(normal.xy * r, r, a_position.w);
- vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
+ vec4 pos = vec4(a_position.xy, 0, 1) * u_modelView;
vec2 shiftedPos = radius.xy + pos.xy;
- pos = vec4(shiftedPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ pos = vec4(shiftedPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
v_radius = radius;
v_color = a_color;
}
diff --git a/shaders/GL/ruler.vsh.glsl b/shaders/GL/ruler.vsh.glsl
index 075b98022b..e092c44f40 100644
--- a/shaders/GL/ruler.vsh.glsl
+++ b/shaders/GL/ruler.vsh.glsl
@@ -4,12 +4,12 @@ attribute vec2 a_colorTexCoords;
uniform vec2 u_position;
uniform float u_length;
-uniform mat4 projection;
+uniform mat4 u_projection;
varying vec2 v_colorTexCoords;
void main()
{
- gl_Position = vec4(u_position + a_position + u_length * a_normal, 0, 1) * projection;
+ gl_Position = vec4(u_position + a_position + u_length * a_normal, 0, 1) * u_projection;
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/shader_index.txt b/shaders/GL/shader_index.txt
index b14849c14e..713e91d276 100644
--- a/shaders/GL/shader_index.txt
+++ b/shaders/GL/shader_index.txt
@@ -1,47 +1,47 @@
-COLORED_SYMBOL_PROGRAM colored_symbol.vsh.glsl colored_symbol.fsh.glsl
-TEXTURING_PROGRAM texturing.vsh.glsl texturing.fsh.glsl
-MASKED_TEXTURING_PROGRAM masked_texturing.vsh.glsl masked_texturing.fsh.glsl
-BOOKMARK_PROGRAM user_mark.vsh.glsl user_mark.fsh.glsl
-BOOKMARK_ANIM_PROGRAM user_mark.vsh.glsl user_mark.fsh.glsl
-TEXT_OUTLINED_PROGRAM text_outlined.vsh.glsl text.fsh.glsl
-TEXT_PROGRAM text.vsh.glsl text.fsh.glsl
-TEXT_FIXED_PROGRAM text.vsh.glsl text_fixed.fsh.glsl
-TEXT_OUTLINED_GUI_PROGRAM text_outlined_gui.vsh.glsl text.fsh.glsl
-AREA_PROGRAM area.vsh.glsl solid_color.fsh.glsl
-AREA_OUTLINE_PROGRAM area.vsh.glsl solid_color.fsh.glsl
-AREA_3D_PROGRAM area3d.vsh.glsl texturing3d.fsh.glsl
-AREA_3D_OUTLINE_PROGRAM area3d_outline.vsh.glsl solid_color.fsh.glsl
-LINE_PROGRAM line.vsh.glsl line.fsh.glsl
-CAP_JOIN_PROGRAM circle.vsh.glsl circle.fsh.glsl
-DASHED_LINE_PROGRAM dashed_line.vsh.glsl dashed_line.fsh.glsl
-PATH_SYMBOL_LINE path_symbol.vsh.glsl texturing.fsh.glsl
-HATCHING_AREA_PROGRAM hatching_area.vsh.glsl hatching_area.fsh.glsl
-TEXTURING_GUI_PROGRAM texturing_gui.vsh.glsl texturing.fsh.glsl
-RULER_PROGRAM ruler.vsh.glsl texturing.fsh.glsl
-ACCURACY_PROGRAM position_accuracy3d.vsh.glsl texturing.fsh.glsl
-MY_POSITION_PROGRAM my_position.vsh.glsl texturing.fsh.glsl
-TRANSIT_PROGRAM transit.vsh.glsl transit.fsh.glsl
-TRANSIT_MARKER_PROGRAM transit_marker.vsh.glsl transit_marker.fsh.glsl
-ROUTE_PROGRAM route.vsh.glsl route.fsh.glsl
-ROUTE_DASH_PROGRAM route.vsh.glsl route_dash.fsh.glsl
-ROUTE_ARROW_PROGRAM route_arrow.vsh.glsl route_arrow.fsh.glsl
-ROUTE_MARKER_PROGRAM route_marker.vsh.glsl route_marker.fsh.glsl
-CIRCLE_POINT_PROGRAM circle_point.vsh.glsl circle_point.fsh.glsl
-DEBUG_RECT_PROGRAM debug_rect.vsh.glsl debug_rect.fsh.glsl
-SCREEN_QUAD_PROGRAM screen_quad.vsh.glsl texturing.fsh.glsl
-ARROW_3D_PROGRAM arrow3d.vsh.glsl arrow3d.fsh.glsl
-ARROW_3D_SHADOW_PROGRAM arrow3d_shadow.vsh.glsl arrow3d_shadow.fsh.glsl
-ARROW_3D_OUTLINE_PROGRAM arrow3d_shadow.vsh.glsl arrow3d_outline.fsh.glsl
-COLORED_SYMBOL_BILLBOARD_PROGRAM colored_symbol_billboard.vsh.glsl colored_symbol.fsh.glsl
-TEXTURING_BILLBOARD_PROGRAM texturing_billboard.vsh.glsl texturing.fsh.glsl
-MASKED_TEXTURING_BILLBOARD_PROGRAM masked_texturing_billboard.vsh.glsl masked_texturing.fsh.glsl
-BOOKMARK_BILLBOARD_PROGRAM user_mark_billboard.vsh.glsl user_mark.fsh.glsl
-BOOKMARK_ANIM_BILLBOARD_PROGRAM user_mark_billboard.vsh.glsl user_mark.fsh.glsl
-TEXT_OUTLINED_BILLBOARD_PROGRAM text_outlined_billboard.vsh.glsl text.fsh.glsl
-TEXT_BILLBOARD_PROGRAM text_billboard.vsh.glsl text.fsh.glsl
-TEXT_FIXED_BILLBOARD_PROGRAM text_billboard.vsh.glsl text_fixed.fsh.glsl
-TRAFFIC_PROGRAM traffic.vsh.glsl traffic.fsh.glsl
-TRAFFIC_LINE_PROGRAM traffic_line.vsh.glsl traffic_line.fsh.glsl
-SMAA_EDGES_PROGRAM smaa_edges.vsh.glsl smaa_edges.fsh.glsl
-SMAA_BLENDING_WEIGHT_PROGRAM smaa_blending_weight.vsh.glsl smaa_blending_weight.fsh.glsl
-SMAA_FINAL_PROGRAM smaa_final.vsh.glsl smaa_final.fsh.glsl
+ColoredSymbol colored_symbol.vsh.glsl colored_symbol.fsh.glsl
+Texturing texturing.vsh.glsl texturing.fsh.glsl
+MaskedTexturing masked_texturing.vsh.glsl masked_texturing.fsh.glsl
+Bookmark user_mark.vsh.glsl user_mark.fsh.glsl
+BookmarkAnim user_mark.vsh.glsl user_mark.fsh.glsl
+TextOutlined text_outlined.vsh.glsl text.fsh.glsl
+Text text.vsh.glsl text.fsh.glsl
+TextFixed text.vsh.glsl text_fixed.fsh.glsl
+TextOutlinedGui text_outlined_gui.vsh.glsl text.fsh.glsl
+Area area.vsh.glsl solid_color.fsh.glsl
+AreaOutline area.vsh.glsl solid_color.fsh.glsl
+Area3d area3d.vsh.glsl texturing3d.fsh.glsl
+Area3dOutline area3d_outline.vsh.glsl solid_color.fsh.glsl
+Line line.vsh.glsl line.fsh.glsl
+CapJoin circle.vsh.glsl circle.fsh.glsl
+DashedLine dashed_line.vsh.glsl dashed_line.fsh.glsl
+PathSymbol path_symbol.vsh.glsl texturing.fsh.glsl
+HatchingArea hatching_area.vsh.glsl hatching_area.fsh.glsl
+TexturingGui texturing_gui.vsh.glsl texturing.fsh.glsl
+Ruler ruler.vsh.glsl texturing.fsh.glsl
+Accuracy position_accuracy3d.vsh.glsl texturing.fsh.glsl
+MyPosition my_position.vsh.glsl texturing.fsh.glsl
+Transit transit.vsh.glsl transit.fsh.glsl
+TransitMarker transit_marker.vsh.glsl transit_marker.fsh.glsl
+Route route.vsh.glsl route.fsh.glsl
+RouteDash route.vsh.glsl route_dash.fsh.glsl
+RouteArrow route_arrow.vsh.glsl route_arrow.fsh.glsl
+RouteMarker route_marker.vsh.glsl route_marker.fsh.glsl
+CirclePoint circle_point.vsh.glsl circle_point.fsh.glsl
+DebugRect debug_rect.vsh.glsl debug_rect.fsh.glsl
+ScreenQuad screen_quad.vsh.glsl texturing.fsh.glsl
+Arrow3d arrow3d.vsh.glsl arrow3d.fsh.glsl
+Arrow3dShadow arrow3d_shadow.vsh.glsl arrow3d_shadow.fsh.glsl
+Arrow3dOutline arrow3d_shadow.vsh.glsl arrow3d_outline.fsh.glsl
+ColoredSymbolBillboard colored_symbol_billboard.vsh.glsl colored_symbol.fsh.glsl
+TexturingBillboard texturing_billboard.vsh.glsl texturing.fsh.glsl
+MaskedTexturingBillboard masked_texturing_billboard.vsh.glsl masked_texturing.fsh.glsl
+BookmarkBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl
+BookmarkAnimBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl
+TextOutlinedBillboard text_outlined_billboard.vsh.glsl text.fsh.glsl
+TextBillboard text_billboard.vsh.glsl text.fsh.glsl
+TextFixedBillboard text_billboard.vsh.glsl text_fixed.fsh.glsl
+Traffic traffic.vsh.glsl traffic.fsh.glsl
+TrafficLine traffic_line.vsh.glsl traffic_line.fsh.glsl
+SmaaEdges smaa_edges.vsh.glsl smaa_edges.fsh.glsl
+SmaaBlendingWeight smaa_blending_weight.vsh.glsl smaa_blending_weight.fsh.glsl
+SmaaFinal smaa_final.vsh.glsl smaa_final.fsh.glsl
diff --git a/shaders/GL/shaders_lib.glsl b/shaders/GL/shaders_lib.glsl
index ee317acc18..0cfbe35f57 100644
--- a/shaders/GL/shaders_lib.glsl
+++ b/shaders/GL/shaders_lib.glsl
@@ -1,7 +1,7 @@
// This is a library of functions which we are use in our shaders.
// Common (DO NOT modify this comment, it marks up block of common functions).
-// Scale factor in shape's coordinates transformation from tile's coordinate
+// Scale factor in shape's coordinates transformation from tile's coorinate
// system.
const float kShapeCoordScalar = 1000.0;
diff --git a/shaders/GL/solid_color.fsh.glsl b/shaders/GL/solid_color.fsh.glsl
index 143240dea1..ac4440148e 100644
--- a/shaders/GL/solid_color.fsh.glsl
+++ b/shaders/GL/solid_color.fsh.glsl
@@ -1,7 +1,7 @@
uniform float u_opacity;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
uniform sampler2D u_colorTex;
varying vec2 v_colorTexCoords;
@@ -10,9 +10,9 @@ varying vec2 v_colorTexCoords;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 finalColor = v_color;
+ LOW_P vec4 finalColor = v_color;
#else
- lowp vec4 finalColor = texture2D(u_colorTex, v_colorTexCoords);
+ LOW_P vec4 finalColor = texture2D(u_colorTex, v_colorTexCoords);
#endif
finalColor.a *= u_opacity;
gl_FragColor = finalColor;
diff --git a/shaders/GL/text.fsh.glsl b/shaders/GL/text.fsh.glsl
index edb8220c6f..9db0e41948 100755
--- a/shaders/GL/text.fsh.glsl
+++ b/shaders/GL/text.fsh.glsl
@@ -1,7 +1,7 @@
varying vec2 v_maskTexCoord;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
uniform sampler2D u_colorTex;
@@ -14,9 +14,9 @@ uniform vec2 u_contrastGamma;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 glyphColor = v_color;
+ LOW_P vec4 glyphColor = v_color;
#else
- lowp vec4 glyphColor = texture2D(u_colorTex, v_colorTexCoord);
+ LOW_P vec4 glyphColor = texture2D(u_colorTex, v_colorTexCoord);
#endif
#ifdef GLES3
float dist = texture2D(u_maskTex, v_maskTexCoord).r;
diff --git a/shaders/GL/text.vsh.glsl b/shaders/GL/text.vsh.glsl
index 1e8858d785..b37f42050a 100644
--- a/shaders/GL/text.vsh.glsl
+++ b/shaders/GL/text.vsh.glsl
@@ -3,13 +3,13 @@ attribute vec2 a_normal;
attribute vec2 a_colorTexCoord;
attribute vec2 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -18,9 +18,9 @@ varying vec2 v_maskTexCoord;
void main()
{
- vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 pos = vec4(a_position.xyz, 1) * u_modelView;
vec4 shiftedPos = vec4(a_normal, 0.0, 0.0) + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoord);
diff --git a/shaders/GL/text_billboard.vsh.glsl b/shaders/GL/text_billboard.vsh.glsl
index 8652bece20..8415bc59d0 100755
--- a/shaders/GL/text_billboard.vsh.glsl
+++ b/shaders/GL/text_billboard.vsh.glsl
@@ -3,15 +3,15 @@ attribute vec2 a_normal;
attribute vec2 a_colorTexCoord;
attribute vec2 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform float u_isOutlinePass;
-uniform float zScale;
+uniform float u_zScale;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -20,10 +20,10 @@ varying vec2 v_maskTexCoord;
void main()
{
- vec4 pivot = vec4(a_position.xyz, 1.0) * modelView;
- vec4 offset = vec4(a_normal, 0.0, 0.0) * projection;
- gl_Position = applyBillboardPivotTransform(pivot * projection, pivotTransform, a_position.w * zScale, offset.xy);
-
+ vec4 pivot = vec4(a_position.xyz, 1.0) * u_modelView;
+ vec4 offset = vec4(a_normal, 0.0, 0.0) * u_projection;
+ gl_Position = applyBillboardPivotTransform(pivot * u_projection, u_pivotTransform,
+ a_position.w * u_zScale, offset.xy);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, a_colorTexCoord);
#else
diff --git a/shaders/GL/text_fixed.fsh.glsl b/shaders/GL/text_fixed.fsh.glsl
index 1fe61a0eeb..681884c07f 100755
--- a/shaders/GL/text_fixed.fsh.glsl
+++ b/shaders/GL/text_fixed.fsh.glsl
@@ -1,7 +1,7 @@
varying vec2 v_maskTexCoord;
#ifdef ENABLE_VTF
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
uniform sampler2D u_colorTex;
@@ -14,9 +14,9 @@ uniform vec2 u_contrastGamma;
void main()
{
#ifdef ENABLE_VTF
- lowp vec4 glyphColor = v_color;
+ LOW_P vec4 glyphColor = v_color;
#else
- lowp vec4 glyphColor = texture2D(u_colorTex, v_colorTexCoord);
+ LOW_P vec4 glyphColor = texture2D(u_colorTex, v_colorTexCoord);
#endif
#ifdef GLES3
float alpha = texture2D(u_maskTex, v_maskTexCoord).r;
diff --git a/shaders/GL/text_outlined.vsh.glsl b/shaders/GL/text_outlined.vsh.glsl
index 8869246d19..3499b0355f 100755
--- a/shaders/GL/text_outlined.vsh.glsl
+++ b/shaders/GL/text_outlined.vsh.glsl
@@ -4,14 +4,14 @@ attribute vec2 a_colorTexCoord;
attribute vec2 a_outlineColorTexCoord;
attribute vec2 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform float u_isOutlinePass;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -26,9 +26,9 @@ void main()
float notOutline = 1.0 - isOutline;
float depthShift = BaseDepthShift * isOutline;
- vec4 pos = (vec4(a_position.xyz, 1) + vec4(0.0, 0.0, depthShift, 0.0)) * modelView;
+ vec4 pos = (vec4(a_position.xyz, 1) + vec4(0.0, 0.0, depthShift, 0.0)) * u_modelView;
vec4 shiftedPos = vec4(a_normal, 0.0, 0.0) + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
vec2 colorTexCoord = a_colorTexCoord * notOutline + a_outlineColorTexCoord * isOutline;
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, colorTexCoord);
diff --git a/shaders/GL/text_outlined_billboard.vsh.glsl b/shaders/GL/text_outlined_billboard.vsh.glsl
index c69fcea736..05ce9046d1 100755
--- a/shaders/GL/text_outlined_billboard.vsh.glsl
+++ b/shaders/GL/text_outlined_billboard.vsh.glsl
@@ -4,15 +4,15 @@ attribute vec2 a_colorTexCoord;
attribute vec2 a_outlineColorTexCoord;
attribute vec2 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform float u_isOutlinePass;
-uniform float zScale;
+uniform float u_zScale;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -26,9 +26,10 @@ void main()
float isOutline = step(0.5, u_isOutlinePass);
float depthShift = kBaseDepthShift * isOutline;
- vec4 pivot = (vec4(a_position.xyz, 1.0) + vec4(0.0, 0.0, depthShift, 0.0)) * modelView;
- vec4 offset = vec4(a_normal, 0.0, 0.0) * projection;
- gl_Position = applyBillboardPivotTransform(pivot * projection, pivotTransform, a_position.w * zScale, offset.xy);
+ vec4 pivot = (vec4(a_position.xyz, 1.0) + vec4(0.0, 0.0, depthShift, 0.0)) * u_modelView;
+ vec4 offset = vec4(a_normal, 0.0, 0.0) * u_projection;
+ gl_Position = applyBillboardPivotTransform(pivot * u_projection, u_pivotTransform,
+ a_position.w * u_zScale, offset.xy);
vec2 colorTexCoord = mix(a_colorTexCoord, a_outlineColorTexCoord, isOutline);
#ifdef ENABLE_VTF
diff --git a/shaders/GL/text_outlined_gui.vsh.glsl b/shaders/GL/text_outlined_gui.vsh.glsl
index 3852b45250..79d154ae48 100755
--- a/shaders/GL/text_outlined_gui.vsh.glsl
+++ b/shaders/GL/text_outlined_gui.vsh.glsl
@@ -4,13 +4,13 @@ attribute vec2 a_colorTexCoord;
attribute vec2 a_outlineColorTexCoord;
attribute vec2 a_maskTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
uniform float u_isOutlinePass;
#ifdef ENABLE_VTF
uniform sampler2D u_colorTex;
-varying lowp vec4 v_color;
+varying LOW_P vec4 v_color;
#else
varying vec2 v_colorTexCoord;
#endif
@@ -24,9 +24,9 @@ void main()
float isOutline = step(0.5, u_isOutlinePass);
float depthShift = kBaseDepthShift * isOutline;
- vec4 pos = (vec4(a_position.xyz, 1.0) + vec4(0.0, 0.0, depthShift, 0.0)) * modelView;
+ vec4 pos = (vec4(a_position.xyz, 1.0) + vec4(0.0, 0.0, depthShift, 0.0)) * u_modelView;
vec4 shiftedPos = vec4(a_normal, 0.0, 0.0) + pos;
- gl_Position = shiftedPos * projection;
+ gl_Position = shiftedPos * u_projection;
vec2 colorTexCoord = mix(a_colorTexCoord, a_outlineColorTexCoord, isOutline);
#ifdef ENABLE_VTF
v_color = texture2D(u_colorTex, colorTexCoord);
diff --git a/shaders/GL/texturing.vsh.glsl b/shaders/GL/texturing.vsh.glsl
index 5a124f8595..9121006cf5 100644
--- a/shaders/GL/texturing.vsh.glsl
+++ b/shaders/GL/texturing.vsh.glsl
@@ -2,16 +2,16 @@ attribute vec4 a_position;
attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoords;
void main()
{
- vec4 pos = vec4(a_position.xyz, 1) * modelView;
+ vec4 pos = vec4(a_position.xyz, 1) * u_modelView;
vec4 shiftedPos = vec4(a_normal, 0, 0) + pos;
- gl_Position = applyPivotTransform(shiftedPos * projection, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(shiftedPos * u_projection, u_pivotTransform, 0.0);
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/texturing_billboard.vsh.glsl b/shaders/GL/texturing_billboard.vsh.glsl
index 5a2c07f40a..5c3d5774d9 100644
--- a/shaders/GL/texturing_billboard.vsh.glsl
+++ b/shaders/GL/texturing_billboard.vsh.glsl
@@ -2,18 +2,18 @@ attribute vec4 a_position;
attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float zScale;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_zScale;
varying vec2 v_colorTexCoords;
void main()
{
- vec4 pivot = vec4(a_position.xyz, 1.0) * modelView;
- vec4 offset = vec4(a_normal, 0.0, 0.0) * projection;
- gl_Position = applyBillboardPivotTransform(pivot * projection, pivotTransform, a_position.w * zScale, offset.xy);
-
+ vec4 pivot = vec4(a_position.xyz, 1.0) * u_modelView;
+ vec4 offset = vec4(a_normal, 0.0, 0.0) * u_projection;
+ gl_Position = applyBillboardPivotTransform(pivot * u_projection, u_pivotTransform,
+ a_position.w * u_zScale, offset.xy);
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/texturing_gui.vsh.glsl b/shaders/GL/texturing_gui.vsh.glsl
index c96683ce48..6ebee8ac20 100644
--- a/shaders/GL/texturing_gui.vsh.glsl
+++ b/shaders/GL/texturing_gui.vsh.glsl
@@ -1,13 +1,13 @@
attribute vec2 a_position;
attribute vec2 a_colorTexCoords;
-uniform mat4 modelView;
-uniform mat4 projection;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
varying vec2 v_colorTexCoords;
void main()
{
- gl_Position = vec4(a_position, 0, 1) * modelView * projection;
+ gl_Position = vec4(a_position, 0, 1) * u_modelView * u_projection;
v_colorTexCoords = a_colorTexCoords;
}
diff --git a/shaders/GL/traffic.vsh.glsl b/shaders/GL/traffic.vsh.glsl
index 2a2f438b8d..6706859bbd 100644
--- a/shaders/GL/traffic.vsh.glsl
+++ b/shaders/GL/traffic.vsh.glsl
@@ -2,9 +2,9 @@ attribute vec3 a_position;
attribute vec4 a_normal;
attribute vec4 a_colorTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform vec4 u_trafficParams;
@@ -17,22 +17,22 @@ const float kArrowVSize = 0.25;
void main()
{
vec2 normal = a_normal.xy;
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
if (dot(normal, normal) != 0.0)
{
vec2 norm = normal * u_trafficParams.x;
if (a_normal.z < 0.0)
norm = normal * u_trafficParams.y;
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + norm,
- modelView, length(norm));
+ u_modelView, length(norm));
}
- float uOffset = length(vec4(kShapeCoordScalar, 0, 0, 0) * modelView) * a_normal.w;
+ float uOffset = length(vec4(kShapeCoordScalar, 0, 0, 0) * u_modelView) * a_normal.w;
v_colorTexCoord = a_colorTexCoord.xy;
float v = mix(a_colorTexCoord.z, a_colorTexCoord.z + kArrowVSize, 0.5 * a_normal.z + 0.5);
v_maskTexCoord = vec2(uOffset * u_trafficParams.z, v) * u_trafficParams.w;
v_maskTexCoord.x *= step(a_colorTexCoord.w, v_maskTexCoord.x);
v_halfLength = a_normal.z;
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/traffic_line.vsh.glsl b/shaders/GL/traffic_line.vsh.glsl
index ef808bc568..3162dd5761 100644
--- a/shaders/GL/traffic_line.vsh.glsl
+++ b/shaders/GL/traffic_line.vsh.glsl
@@ -1,16 +1,16 @@
attribute vec3 a_position;
attribute vec2 a_colorTexCoord;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
varying vec2 v_colorTexCoord;
void main()
{
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
v_colorTexCoord = a_colorTexCoord;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/transit.vsh.glsl b/shaders/GL/transit.vsh.glsl
index 60511017c7..39f7ffd7ec 100644
--- a/shaders/GL/transit.vsh.glsl
+++ b/shaders/GL/transit.vsh.glsl
@@ -2,9 +2,9 @@ attribute vec3 a_position;
attribute vec4 a_normal;
attribute vec4 a_color;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform float u_lineHalfWidth;
@@ -13,14 +13,14 @@ varying vec4 v_color;
void main()
{
vec2 normal = a_normal.xy;
- vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * modelView).xy;
+ vec2 transformedAxisPos = (vec4(a_position.xy, 0.0, 1.0) * u_modelView).xy;
if (dot(normal, normal) != 0.0)
{
vec2 norm = normal * u_lineHalfWidth;
transformedAxisPos = calcLineTransformedAxisPos(transformedAxisPos, a_position.xy + norm,
- modelView, length(norm));
+ u_modelView, length(norm));
}
v_color = a_color;
- vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ vec4 pos = vec4(transformedAxisPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
}
diff --git a/shaders/GL/transit_marker.vsh.glsl b/shaders/GL/transit_marker.vsh.glsl
index fca88063f1..6e9d560a0c 100644
--- a/shaders/GL/transit_marker.vsh.glsl
+++ b/shaders/GL/transit_marker.vsh.glsl
@@ -2,9 +2,9 @@ attribute vec3 a_position;
attribute vec4 a_normal;
attribute vec4 a_color;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
uniform vec3 u_params;
@@ -13,12 +13,12 @@ varying vec4 v_color;
void main()
{
- vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
+ vec4 pos = vec4(a_position.xy, 0, 1) * u_modelView;
vec2 normal = vec2(a_normal.x * u_params.x - a_normal.y * u_params.y,
a_normal.x * u_params.y + a_normal.y * u_params.x);
vec2 shiftedPos = normal * u_params.z + pos.xy;
- pos = vec4(shiftedPos, a_position.z, 1.0) * projection;
- gl_Position = applyPivotTransform(pos, pivotTransform, 0.0);
+ pos = vec4(shiftedPos, a_position.z, 1.0) * u_projection;
+ gl_Position = applyPivotTransform(pos, u_pivotTransform, 0.0);
vec2 offsets = abs(a_normal.zw);
v_offsets = vec4(a_normal.zw, offsets - 1.0);
v_color = a_color;
diff --git a/shaders/GL/user_mark.vsh.glsl b/shaders/GL/user_mark.vsh.glsl
index 6852b81506..25d6252054 100644
--- a/shaders/GL/user_mark.vsh.glsl
+++ b/shaders/GL/user_mark.vsh.glsl
@@ -3,10 +3,10 @@ attribute vec2 a_normal;
attribute vec4 a_texCoords;
attribute vec4 a_colorAndAnimate;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float u_interpolationT;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_interpolation;
varying vec4 v_texCoords;
varying vec3 v_maskColor;
@@ -15,12 +15,12 @@ void main()
{
vec2 normal = a_normal;
if (a_colorAndAnimate.w > 0.0)
- normal = u_interpolationT * normal;
+ normal = u_interpolation * normal;
- vec4 p = vec4(a_position, 1.0) * modelView;
+ vec4 p = vec4(a_position, 1.0) * u_modelView;
vec4 pos = vec4(normal, 0.0, 0.0) + p;
- vec4 projectedPivot = p * projection;
- gl_Position = applyPivotTransform(pos * projection, pivotTransform, 0.0);
+ vec4 projectedPivot = p * u_projection;
+ gl_Position = applyPivotTransform(pos * u_projection, u_pivotTransform, 0.0);
gl_Position.z = projectedPivot.y / projectedPivot.w * 0.5 + 0.5;
v_texCoords = a_texCoords;
v_maskColor = a_colorAndAnimate.rgb;
diff --git a/shaders/GL/user_mark_billboard.vsh.glsl b/shaders/GL/user_mark_billboard.vsh.glsl
index 88d3ae9827..a15f9a3137 100644
--- a/shaders/GL/user_mark_billboard.vsh.glsl
+++ b/shaders/GL/user_mark_billboard.vsh.glsl
@@ -3,10 +3,10 @@ attribute vec2 a_normal;
attribute vec4 a_texCoords;
attribute vec4 a_colorAndAnimate;
-uniform mat4 modelView;
-uniform mat4 projection;
-uniform mat4 pivotTransform;
-uniform float u_interpolationT;
+uniform mat4 u_modelView;
+uniform mat4 u_projection;
+uniform mat4 u_pivotTransform;
+uniform float u_interpolation;
varying vec4 v_texCoords;
varying vec3 v_maskColor;
@@ -15,12 +15,12 @@ void main()
{
vec2 normal = a_normal;
if (a_colorAndAnimate.w > 0.0)
- normal = u_interpolationT * normal;
+ normal = u_interpolation * normal;
- vec4 pivot = vec4(a_position.xyz, 1.0) * modelView;
- vec4 offset = vec4(normal, 0.0, 0.0) * projection;
- vec4 projectedPivot = pivot * projection;
- gl_Position = applyBillboardPivotTransform(projectedPivot, pivotTransform, 0.0, offset.xy);
+ vec4 pivot = vec4(a_position.xyz, 1.0) * u_modelView;
+ vec4 offset = vec4(normal, 0.0, 0.0) * u_projection;
+ vec4 projectedPivot = pivot * u_projection;
+ gl_Position = applyBillboardPivotTransform(projectedPivot, u_pivotTransform, 0.0, offset.xy);
gl_Position.z = projectedPivot.y / projectedPivot.w * 0.5 + 0.5;
v_texCoords = a_texCoords;
v_maskColor = a_colorAndAnimate.rgb;