From 832a2f00b98cd9f1cabd83ff92d7be9530643ba5 Mon Sep 17 00:00:00 2001 From: Will McKinnon Date: Tue, 17 Jan 2023 02:07:17 -0500 Subject: [PATCH] removed extraneous shader changes --- sway/desktop/shaders/corner.frag | 6 +++--- sway/desktop/shaders/quad_round_tl.frag | 4 ++-- sway/desktop/shaders/quad_round_tr.frag | 4 ++-- sway/desktop/shaders/tex_external.frag | 4 ++-- sway/desktop/shaders/tex_rgba.frag | 4 ++-- sway/desktop/shaders/tex_rgbx.frag | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sway/desktop/shaders/corner.frag b/sway/desktop/shaders/corner.frag index 25920b77..7699299a 100644 --- a/sway/desktop/shaders/corner.frag +++ b/sway/desktop/shaders/corner.frag @@ -18,10 +18,10 @@ float roundedBoxSDF(vec2 center, vec2 size, float radius) { void main() { vec2 center = gl_FragCoord.xy - position - half_size; - float dist = roundedBoxSDF(center, half_size - half_thickness, radius + half_thickness); - float smoothedAlphaOuter = 1.0 - smoothstep(-1.0, 1.0, dist - half_thickness); + float distance = roundedBoxSDF(center, half_size - half_thickness, radius + half_thickness); + float smoothedAlphaOuter = 1.0 - smoothstep(-1.0, 1.0, distance - half_thickness); // Create an inner circle that isn't as anti-aliased as the outer ring - float smoothedAlphaInner = 1.0 - smoothstep(-1.0, 0.5, dist + half_thickness); + float smoothedAlphaInner = 1.0 - smoothstep(-1.0, 0.5, distance + half_thickness); gl_FragColor = mix(vec4(0), v_color, smoothedAlphaOuter - smoothedAlphaInner); if (is_top_left && (center.y > 0.0 || center.x > 0.0)) { diff --git a/sway/desktop/shaders/quad_round_tl.frag b/sway/desktop/shaders/quad_round_tl.frag index 8f10cce6..758fece9 100644 --- a/sway/desktop/shaders/quad_round_tl.frag +++ b/sway/desktop/shaders/quad_round_tl.frag @@ -8,7 +8,7 @@ uniform float radius; void main() { vec2 q = abs(gl_FragCoord.xy - position - size) - size + radius; - float dist = min(max(q.x,q.y), 0.0) + length(max(q, 0.0)) - radius; - float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, dist); + float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; + float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, distance); gl_FragColor = mix(vec4(0), v_color, smoothedAlpha); } diff --git a/sway/desktop/shaders/quad_round_tr.frag b/sway/desktop/shaders/quad_round_tr.frag index 385cb331..1d8e879f 100644 --- a/sway/desktop/shaders/quad_round_tr.frag +++ b/sway/desktop/shaders/quad_round_tr.frag @@ -8,7 +8,7 @@ uniform float radius; void main() { vec2 q = abs(gl_FragCoord.xy - position - vec2(0, size.y)) - size + radius; - float dist = min(max(q.x,q.y), 0.0) + length(max(q, 0.0)) - radius; - float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, dist); + float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; + float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, distance); gl_FragColor = mix(vec4(0), v_color, smoothedAlpha); } diff --git a/sway/desktop/shaders/tex_external.frag b/sway/desktop/shaders/tex_external.frag index adcbc7bb..9976eb51 100644 --- a/sway/desktop/shaders/tex_external.frag +++ b/sway/desktop/shaders/tex_external.frag @@ -29,8 +29,8 @@ void main() { if (!has_titlebar || gl_FragCoord.y - position.y > radius) { vec2 corner_distance = min(gl_FragCoord.xy - position, size + position - gl_FragCoord.xy); if (max(corner_distance.x, corner_distance.y) < radius) { - float dist = radius - distance(corner_distance, vec2(radius)); - float smooth = smoothstep(-1.0f, 0.5f, dist); + float d = radius - distance(corner_distance, vec2(radius)); + float smooth = smoothstep(-1.0f, 0.5f, d); gl_FragColor = mix(vec4(0), gl_FragColor, smooth); } } diff --git a/sway/desktop/shaders/tex_rgba.frag b/sway/desktop/shaders/tex_rgba.frag index 65b46bc6..b46885b2 100644 --- a/sway/desktop/shaders/tex_rgba.frag +++ b/sway/desktop/shaders/tex_rgba.frag @@ -27,8 +27,8 @@ void main() { if (!has_titlebar || gl_FragCoord.y - position.y > radius) { vec2 corner_distance = min(gl_FragCoord.xy - position, size + position - gl_FragCoord.xy); if (max(corner_distance.x, corner_distance.y) < radius) { - float dist = radius - distance(corner_distance, vec2(radius)); - float smooth = smoothstep(-1.0f, 0.5f, dist); + float d = radius - distance(corner_distance, vec2(radius)); + float smooth = smoothstep(-1.0f, 0.5f, d); gl_FragColor = mix(vec4(0), gl_FragColor, smooth); } } diff --git a/sway/desktop/shaders/tex_rgbx.frag b/sway/desktop/shaders/tex_rgbx.frag index 7fa68ca4..283963f2 100644 --- a/sway/desktop/shaders/tex_rgbx.frag +++ b/sway/desktop/shaders/tex_rgbx.frag @@ -26,8 +26,8 @@ void main() { if (!has_titlebar || gl_FragCoord.y - position.y > radius) { vec2 corner_distance = min(gl_FragCoord.xy - position, size + position - gl_FragCoord.xy); if (max(corner_distance.x, corner_distance.y) < radius) { - float dist = radius - distance(corner_distance, vec2(radius)); - float smooth = smoothstep(-1.0f, 0.5f, dist); + float d = radius - distance(corner_distance, vec2(radius)); + float smooth = smoothstep(-1.0f, 0.5f, d); gl_FragColor = mix(vec4(0), gl_FragColor, smooth); } }