1 // Vertex weighting/blendin shader
5 uniform mat4 mat0, mat1;
6 attribute float weight;
10 // simple diffuse shading
11 // Note that we should really transform the normal vector along with
12 // the postion below... someday.
13 vec3 lightVec = vec3(0, 0, 1);
14 vec3 norm = gl_NormalMatrix * gl_Normal;
15 float dot = 0.2 + max(0.0, dot(norm, lightVec));
16 gl_FrontColor = vec4(dot);
18 // compute sum of weighted transformations
19 vec4 pos0 = mat0 * gl_Vertex;
20 vec4 pos1 = mat1 * gl_Vertex;
21 vec4 pos = mix(pos0, pos1, weight);
23 gl_Position = gl_ModelViewProjectionMatrix * pos;