From e9af9d4451f1ff66c13040b46d8316b52539901b Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 15 Jun 2025 10:57:29 +0900 Subject: [PATCH] enhance(frontend/image-effector): tweak fxs --- .../src/utility/image-effector/fxs/glitch.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/frontend/src/utility/image-effector/fxs/glitch.ts b/packages/frontend/src/utility/image-effector/fxs/glitch.ts index 94027e0e31..702b476a0b 100644 --- a/packages/frontend/src/utility/image-effector/fxs/glitch.ts +++ b/packages/frontend/src/utility/image-effector/fxs/glitch.ts @@ -52,17 +52,19 @@ export const FX_glitch = defineImageEffectorFx({ }, strength: { type: 'number' as const, - default: 5, - min: -100, - max: 100, + default: 0.05, + min: -1, + max: 1, step: 0.01, + toViewValue: v => Math.round(v * 100) + '%', }, size: { type: 'number' as const, - default: 20, + default: 0.2, min: 0, - max: 100, + max: 1, step: 0.01, + toViewValue: v => Math.round(v * 100) + '%', }, channelShift: { type: 'number' as const, @@ -88,10 +90,10 @@ export const FX_glitch = defineImageEffectorFx({ gl.uniform1f(o, rnd()); const s = gl.getUniformLocation(program, `u_shiftStrengths[${i.toString()}]`); - gl.uniform1f(s, (1 - (rnd() * 2)) * (params.strength / 100)); + gl.uniform1f(s, (1 - (rnd() * 2)) * params.strength); const h = gl.getUniformLocation(program, `u_shiftHeights[${i.toString()}]`); - gl.uniform1f(h, rnd() * (params.size / 100)); + gl.uniform1f(h, rnd() * params.size); } }, });