mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 21:25:58 +01:00
shaders: Remove redundant clamp of smoothsteps return value. (#3456)
This commit is contained in:
parent
6a4643842d
commit
772c7d1d3c
2 changed files with 5 additions and 5 deletions
|
@ -71,11 +71,11 @@ void main() {
|
||||||
|
|
||||||
if (dist < radius - h) {
|
if (dist < radius - h) {
|
||||||
// lower
|
// lower
|
||||||
float normalized = clamp(smoothstep(0.0, 1.0, dist - radius + thick + 0.5), 0.0, 1.0);
|
float normalized = smoothstep(0.0, 1.0, dist - radius + thick + 0.5);
|
||||||
additionalAlpha *= normalized;
|
additionalAlpha *= normalized;
|
||||||
} else {
|
} else {
|
||||||
// higher
|
// higher
|
||||||
float normalized = 1.0 - clamp(smoothstep(0.0, 1.0, dist - radius + 0.5), 0.0, 1.0);
|
float normalized = 1.0 - smoothstep(0.0, 1.0, dist - radius + 0.5);
|
||||||
additionalAlpha *= normalized;
|
additionalAlpha *= normalized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
|
||||||
if (dist > radius - 1.0) {
|
if (dist > radius - 1.0) {
|
||||||
float dist = length(pixCoord);
|
float dist = length(pixCoord);
|
||||||
|
|
||||||
float normalized = 1.0 - clamp(smoothstep(0.0, 1.0, dist - radius + 0.5), 0.0, 1.0);
|
float normalized = 1.0 - smoothstep(0.0, 1.0, dist - radius + 0.5);
|
||||||
|
|
||||||
)#" +
|
)#" +
|
||||||
colorVarName + R"#( = )#" + colorVarName + R"#( * normalized;
|
colorVarName + R"#( = )#" + colorVarName + R"#( * normalized;
|
||||||
|
@ -100,7 +100,7 @@ void main() {
|
||||||
|
|
||||||
if (discardOpaque == 1 && pixColor[3] * alpha == 1.0)
|
if (discardOpaque == 1 && pixColor[3] * alpha == 1.0)
|
||||||
discard;
|
discard;
|
||||||
|
|
||||||
if (discardAlpha == 1 && pixColor[3] <= discardAlphaValue)
|
if (discardAlpha == 1 && pixColor[3] <= discardAlphaValue)
|
||||||
discard;
|
discard;
|
||||||
|
|
||||||
|
@ -349,4 +349,4 @@ void main() {
|
||||||
|
|
||||||
gl_FragColor = pixColor;
|
gl_FragColor = pixColor;
|
||||||
}
|
}
|
||||||
)#";
|
)#";
|
||||||
|
|
Loading…
Reference in a new issue