Advertisement
neokabuto

Diffuse fragment shader

Apr 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #version 330
  2.  
  3. in vec3 v_norm;
  4. in vec4 v_pos;
  5. in mat4 mv;
  6. in vec3 v_lightDirection;
  7. out vec4 outputColor;
  8.  
  9. void
  10. main()
  11. {
  12. vec3 ambientColor = vec3(0.1, 0.1, 0.1);
  13. vec3 lightColor = vec3(0.6, 0.55, 0.55);
  14. float lambertDiffuse = max(dot(v_norm, v_lightDirection), 0.0);
  15.  
  16. outputColor.a = 1.0;
  17. outputColor.rgb = ambientColor + lightColor * lambertDiffuse;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement