mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: squishy low
This commit is contained in:
1 parent
19a2492555
commit
af13e3f184
3 files changed
+25
-13
No files matched your search
@@ -1,9 +1,17 @@
|
||||
const GAMMA = 1.2;
|
||||
|
||||
export function fakeLog(x: number, a = 1) {
|
||||
export function fakeLogSquishyHigh(x: number) {
|
||||
return Math.sin((Math.PI / 2) * x) ** (1 / GAMMA);
|
||||
}
|
||||
|
||||
export function fakeLogInverse(y: number, a = 1) {
|
||||
export function fakeLogSquishyHighInverse(y: number) {
|
||||
return (2 / Math.PI) * Math.asin(y ** GAMMA);
|
||||
}
|
||||
|
||||
export function fakeLogSquishyLow(x: number) {
|
||||
return x ** 2;
|
||||
}
|
||||
|
||||
export function fakeLogSquishyLowInverse(y: number) {
|
||||
return y ** (1 / 2);
|
||||
}
|
||||
Reference in new issue
Block a user