Advertisement
Guest User

Untitled

a guest
Jan 5th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. ///VERTEX SHADER
  2.  
  3. #version 330
  4.  
  5. uniform mat4 transformationMatrix;
  6. uniform mat4 projectionMatrix;
  7. uniform mat4 viewMatrix;
  8.  
  9. void main(){
  10.  
  11. vec4 worldPosition = transformationMatrix * vec4(gl_Position.xyz, 1.0);
  12. vec4 positionRelativeToCam = viewMatrix * worldPosition;
  13. gl_Position = projectionMatrix * positionRelativeToCam;
  14.  
  15. }
  16.  
  17.  
  18. //FRAGMENT SHADER
  19.  
  20. #version 330
  21.  
  22. uniform vec4 color;
  23.  
  24. void main(){
  25.  
  26. gl_FragColor = color;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement