per-pixel wave reveal mask for lock screen overlay layers

This commit is contained in:
Damocles 2026-04-18 11:35:51 +02:00
parent e4b257d760
commit e2f8accbc1
3 changed files with 59 additions and 33 deletions

View file

@ -0,0 +1,21 @@
#version 440
layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform buf {
mat4 qt_Matrix;
float qt_Opacity;
float uPhase;
float uWidth;
};
layout(binding = 1) uniform sampler2D source;
void main() {
vec4 tex = texture(source, qt_TexCoord0);
float x = qt_TexCoord0.x * uWidth;
// Soft reveal edge: fully visible 200px behind wave, fades out 50px ahead
float mask = 1.0 - smoothstep(uPhase - 200.0, uPhase + 50.0, x);
fragColor = tex * mask * qt_Opacity;
}