default.txt 605 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // vertex shader
  2. #version 150
  3. in vec2 in_Position;
  4. in vec3 in_Color;
  5. out vec3 ex_Color;
  6. void main(void) {
  7. gl_Position = vec4(in_Position.x, in_Position.y, 0.0, 1.0);
  8. ex_Color = in_Color;
  9. }
  10. // geometry shader
  11. #version 150
  12. layout(triangles) in;
  13. layout(triangle_strip, max_vertices = 3) out;
  14. void main() {
  15. for(int i = 0; i < gl_in.length(); i++) {
  16. gl_Position = gl_in[i].gl_Position;
  17. EmitVertex();
  18. }
  19. EndPrimitive();
  20. }
  21. // fragment shader
  22. #version 150
  23. precision highp float;
  24. in vec3 ex_Color;
  25. out vec4 gl_FragColor;
  26. void main(void) {
  27. gl_FragColor = vec4(ex_Color, 1.0);
  28. }