summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorDickby <felix.dick@web.de>2023-09-30 14:12:48 +0200
committerGitHub <noreply@github.com>2023-09-30 13:12:48 +0100
commit772c7d1d3cc7b3dd38450edf0ac1152419ef9eb1 (patch)
treec07cba8ff31f71e5435aea8e7af181ead4bdcf15 /src/render
parent6a4643842dfc068e3759bab9ce2f9c55b845f2df (diff)
shaders: Remove redundant clamp of smoothsteps return value. (#3456)
Diffstat (limited to 'src/render')
-rw-r--r--src/render/shaders/Border.hpp4
-rw-r--r--src/render/shaders/Textures.hpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/render/shaders/Border.hpp b/src/render/shaders/Border.hpp
index a4ab50ee..f7b9d94d 100644
--- a/src/render/shaders/Border.hpp
+++ b/src/render/shaders/Border.hpp
@@ -71,11 +71,11 @@ void main() {
if (dist < radius - h) {
// 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;
} else {
// 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;
}
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index dac511c7..109840ca 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -22,7 +22,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
if (dist > radius - 1.0) {
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;
@@ -100,7 +100,7 @@ void main() {
if (discardOpaque == 1 && pixColor[3] * alpha == 1.0)
discard;
-
+
if (discardAlpha == 1 && pixColor[3] <= discardAlphaValue)
discard;
@@ -349,4 +349,4 @@ void main() {
gl_FragColor = pixColor;
}
-)#"; \ No newline at end of file
+)#";