aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/shaders/Textures.hpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-11-05 16:11:05 +0000
committerVaxry <[email protected]>2024-11-05 16:11:05 +0000
commit0920572e703201368c9fbcc9108ce1888600ffa2 (patch)
tree3f11edb6e4c9d7ffcb02bdcc75caac6b63121379 /src/render/shaders/Textures.hpp
parent55ccb1a8cf2c8541a32890e9b76e7c20fc9227cd (diff)
downloadHyprland-0920572e703201368c9fbcc9108ce1888600ffa2.tar.gz
Hyprland-0920572e703201368c9fbcc9108ce1888600ffa2.zip
shaders: improve corner AA in borders shader
Diffstat (limited to 'src/render/shaders/Textures.hpp')
-rw-r--r--src/render/shaders/Textures.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index e99d0a49..b203ad04 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -1,6 +1,8 @@
#pragma once
#include <string>
+#include <format>
+#include "SharedValues.hpp"
inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVarName) -> std::string {
return R"#(
@@ -13,7 +15,9 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
pixCoord -= fullSize * 0.5 - radius;
pixCoord += vec2(1.0, 1.0) / fullSize; // center the pix dont make it top-left
- const float SMOOTHING_CONSTANT = 0.651724; // smoothing constant for the edge: more = blurrier, but smoother
+ // smoothing constant for the edge: more = blurrier, but smoother
+ const float SMOOTHING_CONSTANT = )#" +
+ std::format("{:.7f}", SHADER_ROUNDED_SMOOTHING_FACTOR) + R"#(;
if (pixCoord.x + pixCoord.y > radius) {