Welcome to mirror list, hosted at ThFree Co, Russian Federation.

path_symbol_vertex_shader.vsh « shaders « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 38c6b7791a74ba9c22a6cecd64fc1679af4f58d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
attribute vec4 a_position;
attribute vec2 a_normal;
attribute vec2 a_colorTexCoords;

uniform mat4 modelView;
uniform mat4 projection;
uniform mat4 pivotTransform;

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;
  shiftedPos = shiftedPos * projection;
  float w = shiftedPos.w;
  shiftedPos.xyw = (pivotTransform * vec4(shiftedPos.xy, 0.0, w)).xyw;
  shiftedPos.z *= shiftedPos.w / w;
  gl_Position = shiftedPos;
  v_colorTexCoords = a_colorTexCoords;
}