feat: add wallpaper transitions, store crop in database per-wallpaper, move CUDA context creation to async thread
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
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
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
// Bow-tie wipe transition adapted from gl-transitions.com
|
||||
// Author: huynx (MIT)
|
||||
// Original: two triangles grow from the top and bottom edges into a bow tie
|
||||
// that reveals the incoming image.
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
float check(vec2 p1, vec2 p2, vec2 p3) {
|
||||
return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
|
||||
}
|
||||
|
||||
bool pointInTriangle(vec2 pt, vec2 p1, vec2 p2, vec2 p3) {
|
||||
bool b1 = check(pt, p1, p2) < 0.0;
|
||||
bool b2 = check(pt, p2, p3) < 0.0;
|
||||
bool b3 = check(pt, p3, p1) < 0.0;
|
||||
return (b1 == b2) && (b2 == b3);
|
||||
}
|
||||
|
||||
bool in_top_triangle(vec2 p) {
|
||||
vec2 vertex1 = vec2(0.5, progress);
|
||||
vec2 vertex2 = vec2(0.5 - progress, 0.0);
|
||||
vec2 vertex3 = vec2(0.5 + progress, 0.0);
|
||||
return pointInTriangle(p, vertex1, vertex2, vertex3);
|
||||
}
|
||||
|
||||
bool in_bottom_triangle(vec2 p) {
|
||||
vec2 vertex1 = vec2(0.5, 1.0 - progress);
|
||||
vec2 vertex2 = vec2(0.5 - progress, 1.0);
|
||||
vec2 vertex3 = vec2(0.5 + progress, 1.0);
|
||||
return pointInTriangle(p, vertex1, vertex2, vertex3);
|
||||
}
|
||||
|
||||
float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt) {
|
||||
vec2 lineDir = bot1 - top;
|
||||
vec2 perpDir = vec2(lineDir.y, -lineDir.x);
|
||||
vec2 dirToPt1 = bot1 - testPt;
|
||||
float dist1 = abs(dot(normalize(perpDir), dirToPt1));
|
||||
|
||||
lineDir = bot2 - top;
|
||||
perpDir = vec2(lineDir.y, -lineDir.x);
|
||||
dirToPt1 = bot2 - testPt;
|
||||
float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);
|
||||
|
||||
if (min_dist < 0.005)
|
||||
return min_dist / 0.005;
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
vec4 transition(vec2 uv) {
|
||||
if (in_top_triangle(uv)) {
|
||||
if (progress < 0.1)
|
||||
return getFromColor(uv);
|
||||
|
||||
if (uv.y < 0.5) {
|
||||
vec2 vertex1 = vec2(0.5, progress);
|
||||
vec2 vertex2 = vec2(0.5 - progress, 0.0);
|
||||
vec2 vertex3 = vec2(0.5 + progress, 0.0);
|
||||
return mix(
|
||||
getFromColor(uv),
|
||||
getToColor(uv),
|
||||
blur_edge(vertex2, vertex3, vertex1, uv));
|
||||
}
|
||||
if (progress > 0.0)
|
||||
return getToColor(uv);
|
||||
return getFromColor(uv);
|
||||
}
|
||||
|
||||
if (in_bottom_triangle(uv)) {
|
||||
if (uv.y >= 0.5) {
|
||||
vec2 vertex1 = vec2(0.5, 1.0 - progress);
|
||||
vec2 vertex2 = vec2(0.5 - progress, 1.0);
|
||||
vec2 vertex3 = vec2(0.5 + progress, 1.0);
|
||||
return mix(
|
||||
getFromColor(uv),
|
||||
getToColor(uv),
|
||||
blur_edge(vertex2, vertex3, vertex1, uv));
|
||||
}
|
||||
return getFromColor(uv);
|
||||
}
|
||||
|
||||
return getFromColor(uv);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Doom-style melt wipe, from gl-transitions.com
|
||||
// Author: Zeh Fernando (MIT)
|
||||
// Description: the outgoing image melts down in uneven columns, like the Doom
|
||||
// screen wipe. Fully procedural (no displacement texture).
|
||||
//
|
||||
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag). Optional
|
||||
// gl-transitions params are fixed here: bars = 30, amplitude = 2.0,
|
||||
// noise = 0.1, frequency = 0.5, dripScale = 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 int bars = 30;
|
||||
const float amplitude = 2.0;
|
||||
const float noise = 0.1;
|
||||
const float frequency = 0.5;
|
||||
const float dripScale = 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);
|
||||
}
|
||||
|
||||
float rand(int num) {
|
||||
return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) *
|
||||
cos(float(num)));
|
||||
}
|
||||
|
||||
float wave(int num) {
|
||||
float fn = float(num) * frequency * 0.1 * float(bars);
|
||||
return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn + 10.0) * 0.3) / 2.0 + 0.5;
|
||||
}
|
||||
|
||||
float drip(int num) {
|
||||
return sin(float(num) / float(bars - 1) * 3.141592) * dripScale;
|
||||
}
|
||||
|
||||
float pos(int num) {
|
||||
return (noise == 0.0 ? wave(num)
|
||||
: mix(wave(num), rand(num), noise)) +
|
||||
(dripScale == 0.0 ? 0.0 : drip(num));
|
||||
}
|
||||
|
||||
vec4 transition(vec2 uv) {
|
||||
int bar = int(uv.x * float(bars));
|
||||
float scale = 1.0 + pos(bar) * amplitude;
|
||||
float phase = progress * scale;
|
||||
float posY = uv.y;
|
||||
|
||||
if (phase + posY < 1.0) {
|
||||
return getFromColor(vec2(uv.x, uv.y + phase));
|
||||
}
|
||||
return getToColor(uv);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Fade (crossfade) transition, from gl-transitions.com.
|
||||
//
|
||||
// Ported to ZShell's own GLSL ABI (same contract as wallpaper_trans_bowtie.frag):
|
||||
// version/precision header is prepended by WallpaperService::shaderSource, the
|
||||
// fullscreen triangle comes from shaders/wallpaper.vert, and getFromColor /
|
||||
// getToColor sample with the crop + per-layer flip convention.
|
||||
//
|
||||
// uniforms: samplers `from`/`to`, vec2 size, vec4 fromCrop, vec4 toCrop,
|
||||
// float fromFlip, float toFlip, float progress (0..1).
|
||||
|
||||
uniform sampler2D from;
|
||||
uniform sampler2D to;
|
||||
uniform vec2 size;
|
||||
uniform vec4 fromCrop;
|
||||
uniform vec4 toCrop;
|
||||
uniform float fromFlip;
|
||||
uniform float toFlip;
|
||||
uniform float progress;
|
||||
|
||||
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), progress);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// Hexagonalize crossfade, from gl-transitions.com
|
||||
// Author: Fernando Kuteken (MIT)
|
||||
// Description: both images turn into hexagons, crossfade, then sharpen again.
|
||||
// Hexagonal math from http://www.redblobgames.com/grids/hexagons/
|
||||
//
|
||||
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag). The
|
||||
// gl-transitions `ratio` contextual value is derived from `size`. Optional
|
||||
// params are fixed here: steps = 50, horizontalHexagons = 20.
|
||||
|
||||
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 int steps = 50;
|
||||
const float horizontalHexagons = 20.0;
|
||||
float ratio;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
struct Hexagon {
|
||||
float q;
|
||||
float r;
|
||||
float s;
|
||||
};
|
||||
|
||||
Hexagon createHexagon(float q, float r) {
|
||||
Hexagon hex;
|
||||
hex.q = q;
|
||||
hex.r = r;
|
||||
hex.s = -q - r;
|
||||
return hex;
|
||||
}
|
||||
|
||||
Hexagon roundHexagon(Hexagon hex) {
|
||||
float q = floor(hex.q + 0.5);
|
||||
float r = floor(hex.r + 0.5);
|
||||
float s = floor(hex.s + 0.5);
|
||||
|
||||
float deltaQ = abs(q - hex.q);
|
||||
float deltaR = abs(r - hex.r);
|
||||
float deltaS = abs(s - hex.s);
|
||||
|
||||
if (deltaQ > deltaR && deltaQ > deltaS)
|
||||
q = -r - s;
|
||||
else if (deltaR > deltaS)
|
||||
r = -q - s;
|
||||
else
|
||||
s = -q - r;
|
||||
|
||||
return createHexagon(q, r);
|
||||
}
|
||||
|
||||
Hexagon hexagonFromPoint(vec2 point, float size) {
|
||||
point.y /= ratio;
|
||||
point = (point - 0.5) / size;
|
||||
|
||||
float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y;
|
||||
float r = 0.0 * point.x + 2.0 / 3.0 * point.y;
|
||||
|
||||
Hexagon hex = createHexagon(q, r);
|
||||
return roundHexagon(hex);
|
||||
}
|
||||
|
||||
vec2 pointFromHexagon(Hexagon hex, float size) {
|
||||
float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5;
|
||||
float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5;
|
||||
return vec2(x, y * ratio);
|
||||
}
|
||||
|
||||
vec4 transition(vec2 uv) {
|
||||
float dist = 2.0 * min(progress, 1.0 - progress);
|
||||
dist = steps > 0 ? ceil(dist * float(steps)) / float(steps) : dist;
|
||||
|
||||
float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons;
|
||||
|
||||
vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size)
|
||||
: uv;
|
||||
|
||||
return mix(getFromColor(point), getToColor(point), progress);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
ratio = size.x / size.y;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Linear blur crossfade, from gl-transitions.com
|
||||
// Author: gre (MIT)
|
||||
// Description: a crossfade that passes through a directional blur.
|
||||
//
|
||||
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag): the version
|
||||
// header is prepended by WallpaperService::shaderSource, the fullscreen
|
||||
// triangle comes from wallpaper.vert, and getFromColor/getToColor apply the
|
||||
// crop + flip convention. `uv` is bottom-left origin per gl-transitions.
|
||||
//
|
||||
// Optional gl-transitions params are fixed here: intensity = 0.1.
|
||||
|
||||
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 intensity = 0.1;
|
||||
const int passes = 6;
|
||||
|
||||
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) {
|
||||
vec4 c1 = vec4(0.0);
|
||||
vec4 c2 = vec4(0.0);
|
||||
|
||||
float disp = intensity * (0.5 - distance(0.5, progress));
|
||||
for (int xi = 0; xi < passes; xi++) {
|
||||
float x = float(xi) / float(passes) - 0.5;
|
||||
for (int yi = 0; yi < passes; yi++) {
|
||||
float y = float(yi) / float(passes) - 0.5;
|
||||
vec2 v = vec2(x, y);
|
||||
c1 += getFromColor(uv + disp * v);
|
||||
c2 += getToColor(uv + disp * v);
|
||||
}
|
||||
}
|
||||
c1 /= float(passes * passes);
|
||||
c2 /= float(passes * passes);
|
||||
return mix(c1, c2, progress);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// Split slide-in (horizontal), from gl-transitions.com
|
||||
// Author: OllyOllyOlly (MIT)
|
||||
// Description: the incoming image slides in as two halves moving horizontally
|
||||
// in opposite directions.
|
||||
//
|
||||
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag).
|
||||
// Optional gl-transitions params are fixed here: reverse = false.
|
||||
|
||||
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 vec2 boundMin = vec2(0.0, 0.0);
|
||||
const vec2 boundMax = vec2(1.0, 1.0);
|
||||
|
||||
bool inBounds(vec2 p) {
|
||||
return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));
|
||||
}
|
||||
|
||||
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 modifier = 1.0;
|
||||
vec2 toP = (uv.y > 0.5)
|
||||
? vec2((uv.x - (progress * modifier)) + modifier, uv.y)
|
||||
: vec2((uv.x + (progress * modifier)) - modifier, uv.y);
|
||||
|
||||
return inBounds(toP) ? getToColor(toP) : getFromColor(uv);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// Tiles wave reveal, from gl-transitions.com
|
||||
// Author: numb3r23 (MIT)
|
||||
// Description: the incoming image is revealed tile by tile in a diagonal wave.
|
||||
//
|
||||
// Ported to ZShell's GLSL ABI (see wallpaper_trans_bowtie.frag).
|
||||
// Optional gl-transitions params are fixed here: tileCount = (8, 8),
|
||||
// flipX = true, flipY = false.
|
||||
|
||||
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 ivec2 tileCount = ivec2(8, 8);
|
||||
const bool flipX = true;
|
||||
const bool flipY = false;
|
||||
|
||||
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) {
|
||||
vec2 tileSize = 1.0 / vec2(tileCount);
|
||||
vec2 posInTile = fract(uv * vec2(tileCount));
|
||||
vec2 tileNum = floor(uv * vec2(tileCount));
|
||||
float countTiles = float(tileCount.x * tileCount.y);
|
||||
|
||||
// Diagonal wave from bottom-left to top-right.
|
||||
float offset = (tileNum.y + tileNum.x * float(tileCount.y)) / countTiles;
|
||||
float timeOffset = clamp((progress - offset) * countTiles, 0.0, 0.5);
|
||||
float sinTime = 1.0 - abs(cos(fract(timeOffset) * 3.1415926));
|
||||
|
||||
vec2 texC = posInTile;
|
||||
|
||||
if (sinTime <= 0.5) {
|
||||
if (flipX) {
|
||||
if (texC.x < sinTime || texC.x > 1.0 - sinTime)
|
||||
return getFromColor(uv);
|
||||
texC.x = texC.x < 0.5
|
||||
? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)
|
||||
: (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;
|
||||
}
|
||||
if (flipY) {
|
||||
if (texC.y < sinTime || texC.y > 1.0 - sinTime)
|
||||
return getFromColor(uv);
|
||||
texC.y = texC.y < 0.5
|
||||
? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)
|
||||
: (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;
|
||||
}
|
||||
vec2 globalUV = tileNum * tileSize + texC * tileSize;
|
||||
return getFromColor(globalUV);
|
||||
} else {
|
||||
if (flipX) {
|
||||
if (texC.x > sinTime || texC.x < 1.0 - sinTime)
|
||||
return getToColor(uv);
|
||||
texC.x = texC.x < 0.5
|
||||
? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)
|
||||
: (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;
|
||||
texC.x = 1.0 - texC.x;
|
||||
}
|
||||
if (flipY) {
|
||||
if (texC.y > sinTime || texC.y < 1.0 - sinTime)
|
||||
return getToColor(uv);
|
||||
texC.y = texC.y < 0.5
|
||||
? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)
|
||||
: (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;
|
||||
texC.y = 1.0 - texC.y;
|
||||
}
|
||||
vec2 globalUV = tileNum * tileSize + texC * tileSize;
|
||||
return getToColor(globalUV);
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// 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);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Hard-edged wipe from top to bottom, 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(1.0 - uv.y, progress));
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / size;
|
||||
outColor = transition(uv);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user