mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 15:06:00 +01:00
fix up the border shader
This commit is contained in:
parent
f45ec24977
commit
1c9a0be8c4
1 changed files with 7 additions and 6 deletions
|
@ -31,19 +31,19 @@ void main() {
|
||||||
|
|
||||||
float dist = length(pixCoord);
|
float dist = length(pixCoord);
|
||||||
|
|
||||||
if (dist > radius || dist < radius - thick - 1.0)
|
if (dist > radius + 1.0 || dist < radius - thick - 1.0)
|
||||||
discard;
|
discard;
|
||||||
|
|
||||||
if (primitiveMultisample == 1 && (dist > radius - 1.0 || dist < radius - thick + 1.0)) {
|
if (primitiveMultisample == 1 && (dist > radius - 1.0 || dist < radius - thick + 1.0)) {
|
||||||
float distances = 0.0;
|
float distances = 0.0;
|
||||||
float len = length(pixCoord + vec2(0.25, 0.25));
|
float len = length(pixCoord + vec2(0.25, 0.25));
|
||||||
distances += float(len < radius && len > radius - thick);
|
distances += float(len < radius + 0.5 && len > radius - thick);
|
||||||
len = length(pixCoord + vec2(0.75, 0.25));
|
len = length(pixCoord + vec2(0.75, 0.25));
|
||||||
distances += float(len < radius && len > radius - thick);
|
distances += float(len < radius + 0.5 && len > radius - thick);
|
||||||
len = length(pixCoord + vec2(0.25, 0.75));
|
len = length(pixCoord + vec2(0.25, 0.75));
|
||||||
distances += float(len < radius && len > radius - thick);
|
distances += float(len < radius + 0.5 && len > radius - thick);
|
||||||
len = length(pixCoord + vec2(0.75, 0.75));
|
len = length(pixCoord + vec2(0.75, 0.75));
|
||||||
distances += float(len < radius && len > radius - thick);
|
distances += float(len < radius + 0.5 && len > radius - thick);
|
||||||
|
|
||||||
if (distances == 0.0)
|
if (distances == 0.0)
|
||||||
discard;
|
discard;
|
||||||
|
@ -51,7 +51,8 @@ void main() {
|
||||||
distances /= 4.0;
|
distances /= 4.0;
|
||||||
|
|
||||||
pixColor = pixColor * distances;
|
pixColor = pixColor * distances;
|
||||||
}
|
} else if (dist > radius || dist < radius - thick)
|
||||||
|
discard;
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue