enhance(frontend/image-effector): tweak fxs

This commit is contained in:
syuilo 2025-06-15 10:57:29 +09:00
parent ce90fee586
commit e9af9d4451
1 changed files with 9 additions and 7 deletions

View File

@ -52,17 +52,19 @@ export const FX_glitch = defineImageEffectorFx({
}, },
strength: { strength: {
type: 'number' as const, type: 'number' as const,
default: 5, default: 0.05,
min: -100, min: -1,
max: 100, max: 1,
step: 0.01, step: 0.01,
toViewValue: v => Math.round(v * 100) + '%',
}, },
size: { size: {
type: 'number' as const, type: 'number' as const,
default: 20, default: 0.2,
min: 0, min: 0,
max: 100, max: 1,
step: 0.01, step: 0.01,
toViewValue: v => Math.round(v * 100) + '%',
}, },
channelShift: { channelShift: {
type: 'number' as const, type: 'number' as const,
@ -88,10 +90,10 @@ export const FX_glitch = defineImageEffectorFx({
gl.uniform1f(o, rnd()); gl.uniform1f(o, rnd());
const s = gl.getUniformLocation(program, `u_shiftStrengths[${i.toString()}]`); 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()}]`); const h = gl.getUniformLocation(program, `u_shiftHeights[${i.toString()}]`);
gl.uniform1f(h, rnd() * (params.size / 100)); gl.uniform1f(h, rnd() * params.size);
} }
}, },
}); });