diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-06 17:44:17 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-06 17:44:17 +0100 |
| commit | f6d325615cb461473e96c9a61cfd877ab8a62075 (patch) | |
| tree | e840c8c2e3c62a9fbacfd42f41e9b5e50e6314fc /desktop/modules/appearance/crosswarp.frag | |
| parent | f14d4ac615fe3ae62d77ed828b6150665a687033 (diff) | |
| download | quickshell-f6d325615cb461473e96c9a61cfd877ab8a62075.tar.gz quickshell-f6d325615cb461473e96c9a61cfd877ab8a62075.zip | |
wallpaper: six more transitions
Ink, shatter, ripple, melt, blinds and cross-warp. Each draws the old
picture exactly at progress 0 and the new one at 1, or the cover would
pop as it comes and goes: rendered under Xvfb with llvmpipe against the
plain pictures, all seven differ by 0 at both ends. Ripple and cross-warp
sample the new picture, the rest are transparent over it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/appearance/crosswarp.frag')
| -rw-r--r-- | desktop/modules/appearance/crosswarp.frag | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/desktop/modules/appearance/crosswarp.frag b/desktop/modules/appearance/crosswarp.frag new file mode 100644 index 0000000..d7fc91a --- /dev/null +++ b/desktop/modules/appearance/crosswarp.frag @@ -0,0 +1,37 @@ +// Copyright (C) 2026 Danilo M. <danix@danix.xyz> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Both pictures pulled away from a random point by their own brightness, +// flowing into each other: the old one stretches as it leaves, the new one +// settles as it arrives. Opaque throughout. Compiled with: +// qsb --qt6 -o crosswarp.frag.qsb crosswarp.frag +#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 progress; + vec2 origin; +}; +layout(binding = 1) uniform sampler2D source; +layout(binding = 2) uniform sampler2D target; + +float luma(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); } + +void main() { + vec2 uv = qt_TexCoord0; + vec2 dir = uv - origin; + float x = smoothstep(0.0, 1.0, progress); + vec2 ua = uv + dir * luma(texture(source, uv).rgb) * x * 0.3; + vec2 ub = uv - dir * luma(texture(target, uv).rgb) * (1.0 - x) * 0.3; + fragColor = vec4(mix(texture(source, ua).rgb, texture(target, ub).rgb, x), 1.0) * qt_Opacity; +} |
