2020-02-03 10:52:39 -08:00
|
|
|
#version 330
|
|
|
|
|
2024-08-20 13:32:52 -05:00
|
|
|
// Distance to the curve, and half the curve width, both as
|
|
|
|
// a ratio of the antialias width
|
|
|
|
in float dist_to_aaw;
|
|
|
|
in float half_width_to_aaw;
|
2023-01-09 16:46:38 -08:00
|
|
|
in vec4 color;
|
2020-02-03 10:52:39 -08:00
|
|
|
|
|
|
|
out vec4 frag_color;
|
|
|
|
|
|
|
|
void main() {
|
2023-01-20 13:22:18 -08:00
|
|
|
frag_color = color;
|
2023-01-18 13:07:18 -08:00
|
|
|
// sdf for the region around the curve we wish to color.
|
2024-08-20 13:32:52 -05:00
|
|
|
float signed_dist_to_region = abs(dist_to_aaw) - half_width_to_aaw;
|
|
|
|
frag_color.a *= smoothstep(0.5, -0.5, signed_dist_to_region);
|
2024-08-20 22:03:45 -05:00
|
|
|
// This line is replaced in VShaderWrapper
|
|
|
|
// MODIFY FRAG COLOR
|
2020-02-03 10:52:39 -08:00
|
|
|
}
|