prosperon/source/shaders/circlefrag.glsl

28 lines
488 B
Plaintext
Raw Normal View History

2022-06-21 23:16:14 -05:00
#version 330
in vec2 coords;
out vec4 color;
2023-05-12 13:22:05 -05:00
in float radius;
2023-05-16 01:31:13 -05:00
in vec4 fcolor;
2023-05-12 13:22:05 -05:00
in vec2 pos;
2022-06-21 23:16:14 -05:00
void main()
{
2023-05-12 13:22:05 -05:00
int thickness = 1;
bool fill = false;
2022-06-21 23:16:14 -05:00
// int tt = thickness + 1;
float R1 = 1.f;
2023-05-12 13:22:05 -05:00
// float R2 = 1.f - (thickness*zoom / radius);
float R2 = 1.f - (thickness/radius);
2022-06-21 23:16:14 -05:00
float dist = sqrt(dot(coords, coords));
2023-01-16 02:16:39 -06:00
if (dist >= R2 && dist <= R1)
2023-05-16 01:31:13 -05:00
color = fcolor;
2023-01-16 02:16:39 -06:00
else if (dist < R2)
2023-05-16 01:31:13 -05:00
color = vec4(fcolor.xyz, 0.1f);
2023-01-16 02:16:39 -06:00
else
2022-06-21 23:16:14 -05:00
discard;
}