From c7e10b0910473c99dbc139f514220b134093c9f0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 12 Jun 2021 18:39:32 +0200 Subject: Add show in shader instead of sf::Vertex --- shaders/rounded_rectangle_mask.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shaders/rounded_rectangle_mask.glsl') diff --git a/shaders/rounded_rectangle_mask.glsl b/shaders/rounded_rectangle_mask.glsl index a4546e3..8cbe0fc 100644 --- a/shaders/rounded_rectangle_mask.glsl +++ b/shaders/rounded_rectangle_mask.glsl @@ -3,7 +3,7 @@ uniform float radius; uniform vec2 resolution; float rounded_rect(vec2 coord, vec2 size, float r) { - return smoothstep(0.0, 2.0, length(max(abs(coord) - size, 0.0)) - r); + return length(max(abs(coord) - size+r, 0.0)) - r; } void main() { @@ -12,7 +12,7 @@ void main() { vec2 size = resolution * 0.5; vec4 texture_color = texture2D(texture, gl_TexCoord[0].xy); - float a = clamp(rounded_rect(uv - center, size - radius, radius), 0.0, 1.0); - texture_color.a *= (1.0 - a); + float a = 1.0 - smoothstep(0.0, 2.0, rounded_rect(uv - center, size, radius)); + texture_color.a *= a; gl_FragColor = texture_color; } \ No newline at end of file -- cgit v1.2.3