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

arrow3d_vertex_shader.vsh « shaders « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1fd6741a9c2c884f78f5cb849d744bf881fc8a6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
attribute vec3 a_pos;
attribute vec3 a_normal;

uniform mat4 m_transform;

varying float v_intensity;

const vec4 lightDir = vec4(1.0, 0.0, 3.0, 0.0);

void main()
{
  vec4 position = m_transform * vec4(a_pos, 1.0);
  vec4 normal = m_transform * vec4(a_normal + a_pos, 1.0);
  v_intensity = max(0.0, -dot(normalize(lightDir), normalize(normal - position)));
  gl_Position = position;
}