diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-09-08 17:04:31 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-09-08 17:04:57 +0200 |
commit | da2988c4356d2756e86037b1c7e859f49583c109 (patch) | |
tree | 73ca076fa1a0f46fa3e3f1e6016d7bf479113491 /shaders | |
parent | 24b0ed2ae8a0d52ceee647e34a943213e9d3bc89 (diff) |
Load theme from file (~/.config/quickmedia/themes/<theme-name>.json and /usr/share/quickmedia/themes/<theme-name>.json)
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/rounded_rectangle.glsl | 2 | ||||
-rw-r--r-- | shaders/rounded_rectangle_mask.glsl | 2 | ||||
-rw-r--r-- | shaders/rounded_rectangle_no_shadow.glsl | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/shaders/rounded_rectangle.glsl b/shaders/rounded_rectangle.glsl index ec3a5c1..2863584 100644 --- a/shaders/rounded_rectangle.glsl +++ b/shaders/rounded_rectangle.glsl @@ -15,7 +15,7 @@ void main() { vec2 size = (resolution - shadow_offset * 2.0) * 0.5; float rect_dist = rounded_rect(uv - center, size, radius); - float a = clamp(1.0 - smoothstep(0.0, 2.0, rect_dist), 0.0, 1.0); + float a = clamp(1.0 - smoothstep(0.0, 1.0, rect_dist), 0.0, 1.0); // same as: if(uv.x >= band_pos.x && uv.x <= band_pos.x + band_size.x && uv.y >= band_pos.y && uv.y <= band_pos.y + band_size.y) vec2 band_blend = step(band_pos, uv) - step(band_pos + band_size, uv); vec4 front_color = mix(gl_Color, band_color, band_blend.x*band_blend.y); diff --git a/shaders/rounded_rectangle_mask.glsl b/shaders/rounded_rectangle_mask.glsl index 2ee2888..f375068 100644 --- a/shaders/rounded_rectangle_mask.glsl +++ b/shaders/rounded_rectangle_mask.glsl @@ -12,7 +12,7 @@ void main() { vec2 size = resolution * 0.5; vec4 texture_color = texture2D(texture, gl_TexCoord[0].xy); - float a = clamp(1.0 - smoothstep(0.0, 2.0, rounded_rect(uv - center, size, radius)), 0.0, 1.0); + float a = clamp(1.0 - smoothstep(0.0, 1.0, rounded_rect(uv - center, size, radius)), 0.0, 1.0); texture_color.a *= a; gl_FragColor = texture_color; }
\ No newline at end of file diff --git a/shaders/rounded_rectangle_no_shadow.glsl b/shaders/rounded_rectangle_no_shadow.glsl index e5915da..c32f842 100644 --- a/shaders/rounded_rectangle_no_shadow.glsl +++ b/shaders/rounded_rectangle_no_shadow.glsl @@ -15,7 +15,7 @@ void main() { vec2 size = (resolution - shadow_offset * 2.0) * 0.5; float rect_dist = rounded_rect(uv - center, size, radius); - float a = clamp(1.0 - smoothstep(0.0, 2.0, rect_dist), 0.0, 1.0); + float a = clamp(1.0 - smoothstep(0.0, 1.0, rect_dist), 0.0, 1.0); // same as: if(uv.x >= band_pos.x && uv.x <= band_pos.x + band_size.x && uv.y >= band_pos.y && uv.y <= band_pos.y + band_size.y) vec2 band_blend = step(band_pos, uv) - step(band_pos + band_size, uv); vec4 front_color = mix(gl_Color, band_color, band_blend.x*band_blend.y); |