aboutsummaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-12 04:05:03 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-12 04:05:03 +0200
commitf903b027871a989c1956e6bf16b47e302a01c763 (patch)
tree4dcf30a392b0442c8e02bc0f5f68ea245775a52d /shaders
parentb83e18c475fa68806accf5d5b23aafcc2234e5dc (diff)
Start from youtube url timestamp
Diffstat (limited to 'shaders')
-rw-r--r--shaders/rounded_rectangle.glsl8
1 files changed, 2 insertions, 6 deletions
diff --git a/shaders/rounded_rectangle.glsl b/shaders/rounded_rectangle.glsl
index 8ba138f..88a057a 100644
--- a/shaders/rounded_rectangle.glsl
+++ b/shaders/rounded_rectangle.glsl
@@ -12,14 +12,10 @@ void main() {
vec2 uv = gl_TexCoord[0].xy * resolution;
vec2 center = resolution * 0.5;
vec2 size = resolution * 0.5;
-
+ vec4 background_color = vec4(0.0, 0.0, 0.0, 0.0);
float a = clamp(rounded_rect(uv - center, size - radius, radius), 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);
vec4 front_color = gl_Color;
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)
front_color = band_color;
- front_color.a *= (1.0 - a);
- gl_FragColor = front_color;
+ gl_FragColor = mix(front_color, background_color, a);
} \ No newline at end of file