summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWill McKinnon <[email protected]>2022-10-26 01:19:02 -0400
committerWill McKinnon <[email protected]>2022-10-26 01:19:02 -0400
commited130cdacce66ed2ae4f9e44bb4ae894beefceca (patch)
treef941ee550fa6663d008122ab75f81075fa3cd4f2 /include
parente6cb4e9fa0d058845f00f3b390ce21f4c33de0a9 (diff)
style: cleaned up rounded corner shader
Diffstat (limited to 'include')
-rw-r--r--include/sway/desktop/shaders.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/sway/desktop/shaders.h b/include/sway/desktop/shaders.h
index a30d45e0..4ff9ca42 100644
--- a/include/sway/desktop/shaders.h
+++ b/include/sway/desktop/shaders.h
@@ -123,24 +123,20 @@ const GLchar corner_fragment_src[] =
"}\n"
"\n"
"void main() {\n"
-" gl_FragColor = v_color;\n"
" vec2 center = gl_FragCoord.xy - position - half_size;\n"
" float distance = roundedBoxSDF(center, half_size - half_thickness, radius + half_thickness);\n"
" float smoothedAlphaOuter = 1.0 - smoothstep(-1.0, 1.0, distance - half_thickness);\n"
// Create an inner circle that isn't as anti-aliased as the outer ring
" float smoothedAlphaInner = 1.0 - smoothstep(-1.0, 0.5, distance + half_thickness);\n"
-" gl_FragColor = mix(vec4(0), gl_FragColor, smoothedAlphaOuter - smoothedAlphaInner);\n"
+" gl_FragColor = mix(vec4(0), v_color, smoothedAlphaOuter - smoothedAlphaInner);\n"
"\n"
" if (is_top_left && (center.y > 0.0 || center.x > 0.0)) {\n"
" discard;\n"
-" }\n"
-" else if (is_top_right && (center.y > 0.0 || center.x < 0.0)) {\n"
+" } else if (is_top_right && (center.y > 0.0 || center.x < 0.0)) {\n"
" discard;\n"
-" }\n"
-" else if (is_bottom_left && (center.y < 0.0 || center.x > 0.0)) {\n"
+" } else if (is_bottom_left && (center.y < 0.0 || center.x > 0.0)) {\n"
" discard;\n"
-" }\n"
-" else if (is_bottom_right && (center.y < 0.0 || center.x < 0.0)) {\n"
+" } else if (is_bottom_right && (center.y < 0.0 || center.x < 0.0)) {\n"
" discard;\n"
" }\n"
"}\n";