Files
z-bar-qt/Plugins/ZShell/Internal/shaders/wallpaper_trans_wipe_right.frag
T
zach e655ec5bc7
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Failing after 28s
Python / verify (pull_request) Failing after 1m29s
Rust / build (pull_request) Successful in 53s
Rust / fmt (pull_request) Successful in 42s
Rust / clippy (pull_request) Successful in 1m4s
feat: add wallpaper transitions, store crop in database per-wallpaper, move CUDA context creation to async thread
2026-10-26 14:47:47 +01:00

35 lines
824 B
GLSL

// Hard-edged wipe from left to right, from gl-transitions.com
// Author: Jake Nelson (MIT)
//
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag).
uniform sampler2D from;
uniform sampler2D to;
uniform vec2 size;
uniform vec4 fromCrop;
uniform vec4 toCrop;
uniform float progress;
uniform float fromFlip;
uniform float toFlip;
out vec4 outColor;
vec4 getFromColor(vec2 uv) {
vec2 s = vec2(uv.x, fromFlip > 0.5 ? 1.0 - uv.y : uv.y);
return texture(from, fromCrop.xy + s * fromCrop.zw);
}
vec4 getToColor(vec2 uv) {
vec2 s = vec2(uv.x, toFlip > 0.5 ? 1.0 - uv.y : uv.y);
return texture(to, toCrop.xy + s * toCrop.zw);
}
vec4 transition(vec2 uv) {
return mix(getFromColor(uv), getToColor(uv), step(0.0 + uv.x, progress));
}
void main() {
vec2 uv = gl_FragCoord.xy / size;
outColor = transition(uv);
}