C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Failing after 32s
Rust / build (pull_request) Successful in 52s
Python / verify (pull_request) Failing after 1m23s
Rust / fmt (pull_request) Successful in 51s
Rust / clippy (pull_request) Successful in 1m2s
43 lines
1.1 KiB
GLSL
43 lines
1.1 KiB
GLSL
// Window slices wipe, from gl-transitions.com
|
|
// Author: gre (MIT)
|
|
// Description: the incoming image appears through vertical slices that widen.
|
|
//
|
|
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag).
|
|
// Optional gl-transitions params are fixed here: count = 10.0,
|
|
// smoothness = 0.5.
|
|
|
|
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;
|
|
|
|
const float count = 10.0;
|
|
const float smoothness = 0.5;
|
|
|
|
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) {
|
|
float pr = smoothstep(-smoothness, 0.0, uv.x - progress * (1.0 + smoothness));
|
|
float s = step(pr, fract(count * uv.x));
|
|
return mix(getFromColor(uv), getToColor(uv), s);
|
|
}
|
|
|
|
void main() {
|
|
vec2 uv = gl_FragCoord.xy / size;
|
|
outColor = transition(uv);
|
|
}
|