From cc3a65bde2e480b2b07b74eeef20d9081d7f730f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 2 Jun 2021 17:42:30 +0200 Subject: Add modern theme Join matrix room by their name instead of id if there is a name. This allows you to join rooms where the homeserver that created the room is no longer participating in the room. --- shaders/rounded_rectangle.glsl | 8 +++++++- shaders/rounded_rectangle_mask.glsl | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 shaders/rounded_rectangle_mask.glsl (limited to 'shaders') diff --git a/shaders/rounded_rectangle.glsl b/shaders/rounded_rectangle.glsl index 7da0826..2753383 100644 --- a/shaders/rounded_rectangle.glsl +++ b/shaders/rounded_rectangle.glsl @@ -1,4 +1,7 @@ uniform float radius; +uniform float band_y; +uniform float band_height; +uniform vec4 band_color; uniform vec2 resolution; float rounded_rect(vec2 coord, vec2 size, float r) { @@ -11,5 +14,8 @@ void main() { 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); - gl_FragColor = mix(gl_Color, background_color, a); + vec4 front_color = gl_Color; + if(uv.y >= band_y && uv.y <= band_y + band_height) + front_color = band_color; + gl_FragColor = mix(front_color, background_color, a); } \ No newline at end of file diff --git a/shaders/rounded_rectangle_mask.glsl b/shaders/rounded_rectangle_mask.glsl new file mode 100644 index 0000000..4725273 --- /dev/null +++ b/shaders/rounded_rectangle_mask.glsl @@ -0,0 +1,17 @@ +uniform sampler2D texture; +uniform float radius; +uniform vec2 resolution; + +float rounded_rect(vec2 coord, vec2 size, float r) { + return length(max(abs(coord) - size, 0.0)) - r; +} + +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); + vec4 texture_color = texture2D(texture, gl_TexCoord[0].xy); + float a = clamp(rounded_rect(uv - center, size - radius, radius), 0.0, 1.0); + gl_FragColor = mix(texture_color, background_color, a); +} \ No newline at end of file -- cgit v1.2.3