per-pixel wave reveal mask for lock screen overlay layers
This commit is contained in:
parent
e4b257d760
commit
e2f8accbc1
3 changed files with 59 additions and 33 deletions
|
|
@ -27,10 +27,13 @@ stdenvNoCC.mkDerivation {
|
||||||
mkdir -p $out/share/nova-shell
|
mkdir -p $out/share/nova-shell
|
||||||
cp -r shell/shell.qml shell/modules shell/services shell/applets shell/lock shell/assets $out/share/nova-shell/
|
cp -r shell/shell.qml shell/modules shell/services shell/applets shell/lock shell/assets $out/share/nova-shell/
|
||||||
|
|
||||||
# Compile fragment shader to Qt RHI format
|
# Compile fragment shaders to Qt RHI format
|
||||||
qsb --qt6 \
|
qsb --qt6 \
|
||||||
-o $out/share/nova-shell/modules/hex_wave.frag.qsb \
|
-o $out/share/nova-shell/modules/hex_wave.frag.qsb \
|
||||||
shell/modules/hex_wave.frag
|
shell/modules/hex_wave.frag
|
||||||
|
qsb --qt6 \
|
||||||
|
-o $out/share/nova-shell/modules/reveal_mask.frag.qsb \
|
||||||
|
shell/modules/reveal_mask.frag
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
makeWrapper ${lib.getExe quickshell} $out/bin/nova-shell \
|
makeWrapper ${lib.getExe quickshell} $out/bin/nova-shell \
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@ WlSessionLockSurface {
|
||||||
|
|
||||||
color: S.Theme.base00
|
color: S.Theme.base00
|
||||||
|
|
||||||
// Wave progress drives blur/dim/hex overlay reveal
|
|
||||||
property real _unlockFade: 1
|
property real _unlockFade: 1
|
||||||
readonly property real _waveProgress: (root.width > 0 ? Math.max(0, Math.min(1, _hexWave.wavePhase / root.width)) : 0) * _unlockFade
|
|
||||||
|
|
||||||
// Clear desktop screenshot - visible immediately
|
// Clear desktop screenshot - visible immediately
|
||||||
ScreencopyView {
|
ScreencopyView {
|
||||||
|
|
@ -25,35 +23,46 @@ WlSessionLockSurface {
|
||||||
opacity: _unlockFade
|
opacity: _unlockFade
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blurred screenshot - fades in as wave passes
|
// Overlay group: blur + dim + hexes, revealed per-pixel by wave position
|
||||||
ScreencopyView {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
captureSource: root.screen
|
opacity: _unlockFade
|
||||||
visible: S.Modules.lock.screenshot ?? true
|
|
||||||
opacity: root._waveProgress
|
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: ShaderEffect {
|
||||||
autoPaddingEnabled: false
|
property real uPhase: _hexWave.wavePhase
|
||||||
blurEnabled: true
|
property real uWidth: root.width
|
||||||
blur: 1
|
fragmentShader: Quickshell.shellPath("modules/reveal_mask.frag.qsb")
|
||||||
blurMax: 64
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Dim overlay - fades in with wave
|
// Blurred screenshot
|
||||||
Rectangle {
|
ScreencopyView {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(S.Theme.base00.r, S.Theme.base00.g, S.Theme.base00.b, 0.4)
|
captureSource: root.screen
|
||||||
opacity: root._waveProgress
|
visible: S.Modules.lock.screenshot ?? true
|
||||||
}
|
|
||||||
|
|
||||||
// Hex wave - fades in with wave progress
|
layer.enabled: true
|
||||||
C.HexWaveBackground {
|
layer.effect: MultiEffect {
|
||||||
id: _hexWave
|
autoPaddingEnabled: false
|
||||||
anchors.fill: parent
|
blurEnabled: true
|
||||||
running: root.lock.secure
|
blur: 1
|
||||||
opacity: root._waveProgress * 0.4
|
blurMax: 64
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dim overlay
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Qt.rgba(S.Theme.base00.r, S.Theme.base00.g, S.Theme.base00.b, 0.4)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hex wave
|
||||||
|
C.HexWaveBackground {
|
||||||
|
id: _hexWave
|
||||||
|
anchors.fill: parent
|
||||||
|
running: root.lock.secure
|
||||||
|
opacity: 0.4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard input via TextInput - engages Qt's full input pipeline including
|
// Keyboard input via TextInput - engages Qt's full input pipeline including
|
||||||
|
|
@ -242,13 +251,6 @@ WlSessionLockSurface {
|
||||||
duration: 300
|
duration: 300
|
||||||
easing.type: Easing.InCubic
|
easing.type: Easing.InCubic
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
|
||||||
target: _hexWave
|
|
||||||
property: "opacity"
|
|
||||||
to: 0
|
|
||||||
duration: 300
|
|
||||||
easing.type: Easing.InCubic
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyAction {
|
PropertyAction {
|
||||||
|
|
|
||||||
21
shell/modules/reveal_mask.frag
Normal file
21
shell/modules/reveal_mask.frag
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue