Advertisement
Guest User

Shaders

a guest
Feb 21st, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Vertex shader:
  2. #version 120
  3.  
  4. attribute vec3 coord2d;
  5. attribute vec3 v_colour;
  6. varying vec3 f_colour;
  7. uniform mat4 mvp;
  8.  
  9. void main(void) {
  10. gl_Position = mvp * vec4(coord2d, 1.0);
  11. f_colour=v_colour;
  12. }
  13.  
  14. Fragment shader:
  15.  
  16. #version 120
  17. varying vec3 f_colour;
  18.  
  19. void main(void) {
  20. gl_FragColor = vec4(f_colour.x, f_colour.y, f_colour.z, 1.0);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement