summaryrefslogtreecommitdiff
path: root/apps/web
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-02 17:43:42 +0100
committerMaze Winther <mazewinther@gmail.com>2026-03-02 17:43:42 +0100
commita635ae9e14df792651387037239e30ebd52ca4ba (patch)
treee45fb22468ea8b2dda9a903669e54ae3cba2a21d /apps/web
parent88bf59d6b4f969aea893b7a9c15396c0b9887897 (diff)
downloadopencut-a635ae9e14df792651387037239e30ebd52ca4ba.tar.gz
fix inconsistency in blur intensity
Diffstat (limited to 'apps/web')
-rw-r--r--apps/web/src/lib/effects/definitions/blur.ts48
1 files changed, 24 insertions, 24 deletions
diff --git a/apps/web/src/lib/effects/definitions/blur.ts b/apps/web/src/lib/effects/definitions/blur.ts
index 3a8f691a..3819f82c 100644
--- a/apps/web/src/lib/effects/definitions/blur.ts
+++ b/apps/web/src/lib/effects/definitions/blur.ts
@@ -19,32 +19,32 @@ export const blurEffectDefinition: EffectDefinition = {
renderer: {
type: "webgl",
passes: [
- {
- fragmentShader: blurFragmentShader,
- uniforms: ({ effectParams }) => {
- const intensity =
- typeof effectParams.intensity === "number"
- ? effectParams.intensity
- : Number.parseFloat(String(effectParams.intensity));
- return {
- u_sigma: Math.max(intensity / 5, 0.001),
- u_direction: [1, 0],
- };
- },
+ {
+ fragmentShader: blurFragmentShader,
+ uniforms: ({ effectParams, width }) => {
+ const intensity =
+ typeof effectParams.intensity === "number"
+ ? effectParams.intensity
+ : Number.parseFloat(String(effectParams.intensity));
+ return {
+ u_sigma: Math.max((intensity / 5) * (width / 1920), 0.001),
+ u_direction: [1, 0],
+ };
},
- {
- fragmentShader: blurFragmentShader,
- uniforms: ({ effectParams }) => {
- const intensity =
- typeof effectParams.intensity === "number"
- ? effectParams.intensity
- : Number.parseFloat(String(effectParams.intensity));
- return {
- u_sigma: Math.max(intensity / 5, 0.001),
- u_direction: [0, 1],
- };
- },
+ },
+ {
+ fragmentShader: blurFragmentShader,
+ uniforms: ({ effectParams, height }) => {
+ const intensity =
+ typeof effectParams.intensity === "number"
+ ? effectParams.intensity
+ : Number.parseFloat(String(effectParams.intensity));
+ return {
+ u_sigma: Math.max((intensity / 5) * (height / 1080), 0.001),
+ u_direction: [0, 1],
+ };
},
+ },
],
},
};