Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform mat4 mvpMatrix;
  2. uniform mat4 rotationMatrix;
  3.  
  4. attribute vec3 position;
  5. attribute vec3 normal;
  6. attribute vec4 color;
  7.  
  8. varying vec4 colorVarying;
  9. varying float lightIntensity;
  10.  
  11. void main()
  12. {
  13.     gl_Position = mvpMatrix * vec4(position, 1.0);
  14.    
  15.     vec4 rotatedNormal = rotationMatrix * vec4(normal, 1.0);   
  16.     lightIntensity = dot(rotatedNormal.xyz, normalize(vec3(0.2, 0.9, -1.0)));
  17.    
  18.     colorVarying = color;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement