circle_mask.swsl 899 B

12345678910111213141516
  1. uniform highp float Zoom;
  2. uniform highp float CircleRadius; //= 15.0; // radius of the circular gradient
  3. uniform highp float CircleMinDist; //= 0.0; // minimum distance from the center of the screen for the gradient
  4. uniform highp float CirclePow; //= 0.5; // the exponent used for the gradient
  5. uniform highp float CircleMax; //= 4.0; // Maximum value for the gradient used for the gradient. Don't worry, the end result gets clamped.
  6. uniform highp float CircleMult; //= 0.5; // Multiplier for the total value of the circle gradient.
  7. void fragment(){
  8. highp vec2 aspect = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
  9. highp float actualZoom = Zoom;
  10. highp float circle = zCircleGradient(aspect, FRAGCOORD.xy, CircleMax, CircleRadius / actualZoom, CircleMinDist / actualZoom, CirclePow) * CircleMult;
  11. COLOR = mix(vec4(0.0), vec4(vec3(0.0), 1.0), clamp(circle, 0.0, 1.0));
  12. }