/usr/share/glmark2/shaders/ideas-lamp-lit.vert is in glmark2-data 2014.03+git20150611.fa71af2d-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | uniform mat4 projection;
uniform mat4 modelview;
uniform mat3 normalMatrix;
varying vec3 vertex_normal;
varying vec4 vertex_position;
varying vec3 eye_direction;
attribute vec3 vertex;
attribute vec3 normal;
vec3 unitvec(vec4 v1, vec4 v2)
{
if (v1.w == 0.0 && v2.w == 0.0)
return vec3(v2 - v1);
if (v1.w == 0.0)
return vec3(-v1);
if (v2.w == 0.0)
return vec3(v2);
return v2.xyz/v2.w - v1.xyz/v1.w;
}
void main()
{
vec4 curVertex = vec4(vertex.x, vertex.y, vertex.z, 1.0);
gl_Position = projection * modelview * curVertex;
vertex_normal = normalMatrix * normal;
vertex_position = modelview * curVertex;
eye_direction = normalize(unitvec(vertex_position, vec4(0.0, 0.0, 0.0, 1.0)));
}
|