chore: replace OpacityMask with MultiEffect Mask
MultiEffect used to do a hard cutoff and not work with soft masks, but since Qt 6.10 (or 6.11) it works correctly, so we don't need the custom mask anymore
This commit is contained in:
parent
94edd751d0
commit
acbc891fc0
8 changed files with 3 additions and 57 deletions
|
|
@ -1,26 +0,0 @@
|
||||||
#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 fadeMargin;
|
|
||||||
};
|
|
||||||
|
|
||||||
layout(binding = 1) uniform sampler2D source;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
vec4 tex = texture(source, qt_TexCoord0);
|
|
||||||
float factor = 1.0;
|
|
||||||
float margin = 0.1;
|
|
||||||
|
|
||||||
if (qt_TexCoord0.y < margin) {
|
|
||||||
factor = qt_TexCoord0.y / margin;
|
|
||||||
} else if (qt_TexCoord0.y > (1.0 - margin)) {
|
|
||||||
factor = (1.0 - qt_TexCoord0.y) / margin;
|
|
||||||
}
|
|
||||||
|
|
||||||
fragColor = tex * factor * qt_Opacity;
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
|
@ -1,19 +0,0 @@
|
||||||
#version 440
|
|
||||||
|
|
||||||
layout(location = 0) in vec2 qt_TexCoord0;
|
|
||||||
layout(location = 0) out vec4 fragColor;
|
|
||||||
|
|
||||||
layout(std140, binding = 0) uniform buf {
|
|
||||||
// qt_Matrix and qt_Opacity must always be both present
|
|
||||||
// if the built-in vertex shader is used.
|
|
||||||
mat4 qt_Matrix;
|
|
||||||
float qt_Opacity;
|
|
||||||
};
|
|
||||||
|
|
||||||
layout(binding = 1) uniform sampler2D source;
|
|
||||||
layout(binding = 2) uniform sampler2D maskSource;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity;
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
|
@ -1,9 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
|
|
||||||
ShaderEffect {
|
|
||||||
required property Item source
|
|
||||||
required property Item maskSource
|
|
||||||
|
|
||||||
fragmentShader: Quickshell.shellPath("assets/shaders/opacitymask.frag.qsb")
|
|
||||||
}
|
|
||||||
|
|
@ -18,7 +18,7 @@ Item {
|
||||||
readonly property string activeSpecial: (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace?.name ?? ""
|
readonly property string activeSpecial: (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace?.name ?? ""
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: Mask {
|
||||||
maskSource: mask
|
maskSource: mask
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: Mask {
|
||||||
maskSource: mask
|
maskSource: mask
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Item {
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.smooth: true
|
layer.smooth: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: Mask {
|
||||||
maskSource: gradientMask
|
maskSource: gradientMask
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue