mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-08 17:25:58 +01:00
Even less branching (taken more or less from the border shader).
This commit is contained in:
parent
0549aa193f
commit
65fb526d5c
1 changed files with 5 additions and 5 deletions
|
@ -22,15 +22,15 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
|
|||
|
||||
if (primitiveMultisample == 1 && dist > radius - 1.0) {
|
||||
float distances = 0.0;
|
||||
if (length(pixCoord + vec2(0.25, 0.25)) < radius) { distances = distances + 1.0; }
|
||||
if (length(pixCoord + vec2(0.75, 0.25)) < radius) { distances = distances + 1.0; }
|
||||
if (length(pixCoord + vec2(0.25, 0.75)) < radius) { distances = distances + 1.0; }
|
||||
if (length(pixCoord + vec2(0.75, 0.75)) < radius) { distances = distances + 1.0; }
|
||||
distances += float(length(pixCoord + vec2(0.25, 0.25)) < radius);
|
||||
distances += float(length(pixCoord + vec2(0.75, 0.25)) < radius);
|
||||
distances += float(length(pixCoord + vec2(0.25, 0.75)) < radius);
|
||||
distances += float(length(pixCoord + vec2(0.75, 0.75)) < radius);
|
||||
|
||||
if (distances == 0.0)
|
||||
discard;
|
||||
|
||||
distances = distances / 4.0;
|
||||
distances /= 4.0;
|
||||
|
||||
)#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue