Guest User

Untitled

a guest
Aug 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 150 core
  2.  
  3. in vec3 vs_in_pos;
  4. in vec3 vs_in_normal;
  5. uniform mat4 tmat;
  6. uniform mat4 rmat;
  7. uniform mat4 scale;
  8. uniform vec3 inverseLightDir = vec3(0.0f,1.0f,0.0f);
  9.  
  10. out float brightness;
  11.  
  12. void main(void) {
  13.     gl_Position = scale*tmat*rmat*vec4(vs_in_pos, 1);
  14.    
  15.     vec3 normalWC = mat3(rmat*scale)*vs_in_normal;
  16.     vec3 normalWCn = normalize(normalWC);
  17.     brightness = max(dot(normalWCn,inverseLightDir),0);
  18.    
  19. }
Add Comment
Please, Sign In to add comment