Guest User

Untitled

a guest
Dec 15th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #VERTEX SHADER
  2. #version 330
  3.  
  4. // Shader adapted from: Florian Boesch
  5. // http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/
  6.  
  7. layout (location = 0) in vec3 VertexPosition;
  8. in vec4 aColor;
  9.  
  10. out vec4 vColor;
  11. uniform mat4 ModelViewMatrix;
  12. uniform mat4 MVP;
  13. uniform vec4 Color;
  14.  
  15. void main()
  16. {
  17.     gl_Position = MVP * vec4(VertexPosition,1.0);
  18.     vColor = Color;
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. #FRAGMENT SHADER
  26. #version 330
  27.  
  28. in vec4 vColor;
  29.  
  30. layout( location = 0 ) out vec4 FragColor;
  31.  
  32. void main(){
  33.     gl_FragColor = vColor;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment