Created
September 25, 2022 03:57
-
-
Save MadebyAe/c6d1cae5903bed27a226eb12ebed17cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Ae | |
// License: MIT | |
uniform vec2 direction; // = vec2(-1.0, 1.0) | |
const float smoothness = 0.5; | |
const vec2 center = vec2(0.5, 0.5); | |
vec4 transition (vec2 uv) { | |
vec2 v = normalize(direction); | |
v /= abs(v.x) + abs(v.y); | |
float d = v.x * center.x + v.y * center.y; | |
float m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 + progress * (1.0 + smoothness))); | |
return mix(getFromColor((uv - 0.5) * (1.0 - m) + 0.5), getToColor((uv - 0.5) * m + 0.5), m); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment