From f6d325615cb461473e96c9a61cfd877ab8a62075 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 6 Nov 2026 17:44:17 +0100 Subject: 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 --- desktop/modules/appearance/melt.frag | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 desktop/modules/appearance/melt.frag (limited to 'desktop/modules/appearance/melt.frag') diff --git a/desktop/modules/appearance/melt.frag b/desktop/modules/appearance/melt.frag new file mode 100644 index 0000000..86ef369 --- /dev/null +++ b/desktop/modules/appearance/melt.frag @@ -0,0 +1,44 @@ +// Copyright (C) 2026 Danilo M. +// +// 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. + +// The old wallpaper running down the screen like wet paint, each column +// starting late by its noise and accelerating. Compiled with: +// qsb --qt6 -o melt.frag.qsb melt.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; + float aspect; +}; +layout(binding = 1) uniform sampler2D source; + +float hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); } + +float noise(vec2 p) { + vec2 i = floor(p), f = fract(p); + vec2 u = f * f * (3.0 - 2.0 * f); + return mix(mix(hash(i), hash(i + vec2(1, 0)), u.x), + mix(hash(i + vec2(0, 1)), hash(i + vec2(1, 1)), u.x), u.y); +} + +void main() { + float x = qt_TexCoord0.x * aspect; + float delay = 0.25 * (noise(vec2(x * 40.0, 0.0)) + noise(vec2(x * 9.0, 3.0))); + float l = clamp((progress - delay) / 0.5, 0.0, 1.0); + + // Past 1, so the bottom row clears the screen. + vec2 uv = vec2(qt_TexCoord0.x, qt_TexCoord0.y - l * l * 1.02); + float a = smoothstep(-0.004, 0.0, uv.y); + fragColor = vec4(texture(source, uv).rgb * a, a) * qt_Opacity; +} -- cgit v1.2.3