🔧 Improve portal effect

This commit is contained in:
Simon Schneegans
2022-12-21 15:42:20 +01:00
parent b218b8d799
commit 201166441b
2 changed files with 73 additions and 54 deletions
+4 -17
View File
@@ -146,24 +146,11 @@ float easeOutQuad(float x) { return -1.0 * x * (x - 2.0); }
float easeInQuad(float x) { return x * x; }
float easeInBack(float x) { return x * x * ((1.70158 + 1) * x - 1.70158); }
float easeInBack(float x, float e) { return x * x * ((e + 1.0) * x - e); }
float easeOutBack(float x) {
float p = x - 1;
return p * p * ((1.70158 + 1) * p + 1.70158) + 1;
}
float easeInOutBack(float x) {
float p = x * 2.0;
float s = 1.70158 * 1.525;
if (p < 1.0) {
return 0.5 * (p * p * ((s + 1) * p - s));
}
p -= 2;
return 0.5 * (p * p * ((s + 1) * p + s) + 2);
float easeOutBack(float x, float e) {
float p = x - 1.0;
return p * p * ((e + 1.0) * p + e) + 1.0;
}
// --------------------------------------------------------------------- edge mask helpers