element/wayland: Add blur background-effect
This commit is contained in:
parent
e4c0716951
commit
a9bf89d8b2
10 changed files with 747 additions and 5 deletions
27
src/backend/render/shaders/blur_upsample.frag
Normal file
27
src/backend/render/shaders/blur_upsample.frag
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#version 100
|
||||
|
||||
precision highp float;
|
||||
|
||||
varying vec2 v_coords;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 half_pixel;
|
||||
uniform float offset;
|
||||
|
||||
uniform float alpha;
|
||||
#if defined(DEBUG_FLAGS)
|
||||
uniform float tint;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
vec4 sum = texture2D(tex, v_coords + vec2(-half_pixel.x * 2.0, 0.0) * offset);
|
||||
sum += texture2D(tex, v_coords + vec2(-half_pixel.x, half_pixel.y) * offset) * 2.0;
|
||||
sum += texture2D(tex, v_coords + vec2(0.0, half_pixel.y * 2.0) * offset);
|
||||
sum += texture2D(tex, v_coords + vec2(half_pixel.x, half_pixel.y) * offset) * 2.0;
|
||||
sum += texture2D(tex, v_coords + vec2(half_pixel.x * 2.0, 0.0) * offset);
|
||||
sum += texture2D(tex, v_coords + vec2(half_pixel.x, -half_pixel.y) * offset) * 2.0;
|
||||
sum += texture2D(tex, v_coords + vec2(0.0, -half_pixel.y * 2.0) * offset);
|
||||
sum += texture2D(tex, v_coords + vec2(-half_pixel.x, -half_pixel.y) * offset) * 2.0;
|
||||
|
||||
gl_FragColor = sum / sum.a;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue