aboutsummaryrefslogtreecommitdiff
path: root/src/render_helpers/shaders/resize_prelude.frag
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-06-18 12:19:23 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-18 14:01:34 +0300
commit66202992c9536c0e01395813f9a611aa111e5ded (patch)
treef76155ad6b1c49c7d409db776441d4cf4ae25f15 /src/render_helpers/shaders/resize_prelude.frag
parenteb59b10050d5806dd6dd42cfb9e93e1b65a24d4f (diff)
downloadniri-66202992c9536c0e01395813f9a611aa111e5ded.tar.gz
niri-66202992c9536c0e01395813f9a611aa111e5ded.tar.bz2
niri-66202992c9536c0e01395813f9a611aa111e5ded.zip
Fix blurry rounded corners on high scales
Diffstat (limited to 'src/render_helpers/shaders/resize_prelude.frag')
-rw-r--r--src/render_helpers/shaders/resize_prelude.frag4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render_helpers/shaders/resize_prelude.frag b/src/render_helpers/shaders/resize_prelude.frag
index 5c052277..519b1ee4 100644
--- a/src/render_helpers/shaders/resize_prelude.frag
+++ b/src/render_helpers/shaders/resize_prelude.frag
@@ -25,6 +25,7 @@ uniform vec4 niri_corner_radius;
uniform float niri_clip_to_geometry;
uniform float niri_alpha;
+uniform float niri_scale;
float niri_rounding_alpha(vec2 coords, vec2 size) {
vec2 center;
@@ -47,5 +48,6 @@ float niri_rounding_alpha(vec2 coords, vec2 size) {
}
float dist = distance(coords, center);
- return 1.0 - smoothstep(radius - 0.5, radius + 0.5, dist);
+ float half_px = 0.5 / niri_scale;
+ return 1.0 - smoothstep(radius - half_px, radius + half_px, dist);
}