You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
539 B

  1. #version 330
  2. // Input uniform values
  3. uniform vec4 color;
  4. // Output fragment color
  5. out vec4 finalColor;
  6. // NOTE: Add here your custom variables
  7. void main()
  8. {
  9. // Each point is drawn as a screen space square of gl_PointSize size. gl_PointCoord contains where we are inside of
  10. // it. (0, 0) is the top left, (1, 1) the bottom right corner.
  11. // Draw each point as a colored circle with alpha 1.0 in the center and 0.0 at the outer edges.
  12. finalColor = vec4(color.rgb, color.a * (1 - length(gl_PointCoord.xy - vec2(0.5))*2));
  13. }