Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. vertex shader:
  2.  
  3. #version 330 core
  4.  
  5. layout (location = 0) in vec2 vertex_position;
  6. layout (location = 1) in vec2 vertex_UV;
  7.  
  8. out vec2 fragment_UV;
  9.  
  10. uniform mat3 MVP;
  11.  
  12. void main(){
  13.  
  14. gl_Position = vec4(MVP*vec3(vertex_position, 1.0),1.0);
  15. fragment_UV = vertex_UV;
  16.  
  17. }
  18.  
  19.  
  20.  
  21. fragment shader:
  22.  
  23. #version 330 core
  24.  
  25. in vec2 fragment_UV;
  26.  
  27. out vec3 color;
  28.  
  29. uniform sampler2D Texture;
  30.  
  31. void main(){
  32. color = texture2D(Texture, fragment_UV).rgb;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement