diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-06-02 17:42:30 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-06-02 17:43:47 +0200 |
commit | cc3a65bde2e480b2b07b74eeef20d9081d7f730f (patch) | |
tree | 1bb5b85ab764592093e8042458ec9f4be0cf904a /shaders | |
parent | 1b6812348e75de21c8f398a7dc944cc427064cc4 (diff) |
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.
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/rounded_rectangle.glsl | 8 | ||||
-rw-r--r-- | shaders/rounded_rectangle_mask.glsl | 17 |
2 files changed, 24 insertions, 1 deletions
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 |