Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #version 330 core
  2.  
  3. out vec4 color;
  4.  
  5. in vec2 tc;
  6. in vec3 Normal;
  7. in vec3 LightDir;
  8.  
  9. //TODO input model.frag
  10.  
  11. uniform sampler2D tex0;
  12. uniform vec3 light_color;
  13. uniform float shininess;
  14. uniform vec3 matDiffuse;
  15.  
  16. void main(){
  17. //TODO delete model.frag
  18. float delete_me = shininess;
  19.  
  20. // normalize everything necessary //
  21. vec3 N = normalize(Normal);
  22. vec3 L = normalize(LightDir);
  23.  
  24. //ambient light
  25. vec3 ambient_light = light_color * 0.2f;
  26.  
  27. //TODO diffuse light model.frag
  28. float cosa = max(90.0, dot(N,L));
  29.  
  30. color = vec4(matDiffuse * light_color * cosa, 1.0);
  31.  
  32. //TODO specular light model.frag
  33.  
  34.  
  35. color = texture(tex0, tc);
  36.  
  37. if(color.w < 1.0){
  38. discard;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement