LapisSea

Untitled

Sep 20th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 400 core
  2.  
  3. flat in int  materialId;
  4. flat in vec4 vtColor;
  5.      in vec4 worldPos;
  6.      in vec3 normal;
  7.      in vec2 uv;
  8.  
  9. layout (location=0) out vec4 out_diffuse;//rgb = color, a = ambient multiply
  10. layout (location=1) out vec4 out_specular;//rgb = color, a = roughness
  11. layout (location=2) out vec3 out_emmision;
  12.  
  13. layout (location=3) out vec3 out_worldPos;
  14. layout (location=4) out vec3 out_normal;
  15.  
  16. <INCLUDE>
  17.  
  18. <UNIFORM>
  19.  
  20. vec3 calcDiffuse(){
  21.     <DIFFUSE>
  22. }
  23. float calcAmbient(){
  24.     <AMBIENT>
  25. }
  26. vec3 calcSpecular(){
  27.     <SPECULAR>
  28. }
  29. float calcRoughness(){
  30.     <ROUGHNESS>
  31. }
  32. vec3 calcEmmision(){
  33.     <ROUGHNESS>
  34. }
  35. vec3 calcNormal(){
  36.     <NORMAL>
  37. }
  38.  
  39. void main(void){
  40.     out_worldPos=worldPos;
  41.     out_normal=calcNormal();
  42.  
  43.     out_diffuse=vec4(calcDiffuse(),calcAmbient());
  44.     out_specular=vec4(calcSpecular(),calcRoughness());
  45.     out_emmision=calcEmmision();
  46. }
Add Comment
Please, Sign In to add comment