duck0VS.glsl 572 B

123456789101112131415161718
  1. precision highp float;
  2. attribute vec3 a_position;
  3. attribute vec3 a_normal;
  4. varying vec3 v_normal;
  5. uniform mat3 u_normalMatrix;
  6. uniform mat4 u_modelViewMatrix;
  7. uniform mat4 u_projectionMatrix;
  8. uniform mat4 u_light0Transform;
  9. varying vec3 v_light0Direction;
  10. attribute vec2 a_texcoord0;
  11. varying vec2 v_texcoord0;
  12. void main(void) {
  13. vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);
  14. v_normal = normalize(u_normalMatrix * a_normal);
  15. v_light0Direction = normalize(mat3(u_light0Transform) * vec3(0.,0.,1.));
  16. v_texcoord0 = a_texcoord0;
  17. gl_Position = u_projectionMatrix * pos;
  18. }