Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

skinning.vert 634B

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