Advertisement
alestane

vetex shader

Jan 25th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #version 150
  2.  
  3. in vec3 position;
  4.  
  5. uniform float height;
  6. uniform float aspect = 4.0/3.0;
  7. uniform float zNear;
  8. uniform float zFar;
  9.  
  10. mat4 camera = mat4(
  11. vec4(1.0/(height*aspect), 0.0, 0.0, 0.0),
  12. vec4( 0.0, 1.0/height, 0.0, 0.0),
  13. vec4( 0.0, 0.0, 2.0/(zFar - zNear), 0.0),
  14. vec4( 0.0, 0.0, -zNear - 1, 1.0)
  15. );
  16.  
  17. void main () {
  18. gl_Position = camera * vec4(position, 1.0);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement