Advertisement
mbl111

Phong.vertex

Dec 12th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #version 330
  2.  
  3. layout (location = 0) in vec3 position;
  4. layout (location = 1) in vec2 texCoord;
  5. layout (location = 2) in vec3 normal;
  6. layout (location = 3) in vec3 colors;
  7.  
  8. out vec2 texCoord0;
  9. out vec3 normal0;
  10. out vec3 worldPos0;
  11. out vec3 colors0;
  12.  
  13. uniform mat4 transform;
  14. uniform mat4 transformPerspective;
  15.  
  16. void main()
  17. {
  18.  
  19. gl_Position = transformPerspective * vec4(position, 1.0);
  20. colors0 = colors;
  21. texCoord0 = texCoord;
  22. normal0 = (transform * vec4(normal, 0.0)).xyz;
  23. worldPos0 = (transform * vec4(position, 1.0)).xyz;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement