nova-shell/shell/modules/reveal_mask.frag

21 lines
560 B
GLSL

#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;
}