aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/shaders/Textures.hpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-11-21 18:09:47 +0000
committervaxerski <[email protected]>2022-11-21 18:09:47 +0000
commitc78db1212ba0d0e53b8c636d745ac9b8c379d2e4 (patch)
treebe2a5eea83af886bb788a696e884f10dcd014a07 /src/render/shaders/Textures.hpp
parentbe03a6186c22f915d3d92df71d2e74c64e816245 (diff)
downloadHyprland-c78db1212ba0d0e53b8c636d745ac9b8c379d2e4.tar.gz
Hyprland-c78db1212ba0d0e53b8c636d745ac9b8c379d2e4.zip
Unify rounding shaders
Diffstat (limited to 'src/render/shaders/Textures.hpp')
-rw-r--r--src/render/shaders/Textures.hpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index 3b696a70..053635b2 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -13,24 +13,24 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
if (pixCoord.x + pixCoord.y > radius) {
- float dist = length(pixCoord);
+ float dist = length(pixCoord);
- if (dist > radius)
- discard;
+ if (dist > radius)
+ discard;
- if (primitiveMultisample == 1 && dist > radius - 1.0) {
- float distances = 0.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 (primitiveMultisample == 1 && dist > radius - 1.0) {
+ float distances = 0.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;
+ if (distances == 0.0)
+ discard;
- distances /= 4.0;
+ distances /= 4.0;
- )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances;
+ )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances;
}
}