mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix inconsistency in blur intensity
This commit is contained in:
@@ -19,32 +19,32 @@ export const blurEffectDefinition: EffectDefinition = {
|
|||||||
renderer: {
|
renderer: {
|
||||||
type: "webgl",
|
type: "webgl",
|
||||||
passes: [
|
passes: [
|
||||||
{
|
{
|
||||||
fragmentShader: blurFragmentShader,
|
fragmentShader: blurFragmentShader,
|
||||||
uniforms: ({ effectParams }) => {
|
uniforms: ({ effectParams, width }) => {
|
||||||
const intensity =
|
const intensity =
|
||||||
typeof effectParams.intensity === "number"
|
typeof effectParams.intensity === "number"
|
||||||
? effectParams.intensity
|
? effectParams.intensity
|
||||||
: Number.parseFloat(String(effectParams.intensity));
|
: Number.parseFloat(String(effectParams.intensity));
|
||||||
return {
|
return {
|
||||||
u_sigma: Math.max(intensity / 5, 0.001),
|
u_sigma: Math.max((intensity / 5) * (width / 1920), 0.001),
|
||||||
u_direction: [1, 0],
|
u_direction: [1, 0],
|
||||||
};
|
};
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
fragmentShader: blurFragmentShader,
|
{
|
||||||
uniforms: ({ effectParams }) => {
|
fragmentShader: blurFragmentShader,
|
||||||
const intensity =
|
uniforms: ({ effectParams, height }) => {
|
||||||
typeof effectParams.intensity === "number"
|
const intensity =
|
||||||
? effectParams.intensity
|
typeof effectParams.intensity === "number"
|
||||||
: Number.parseFloat(String(effectParams.intensity));
|
? effectParams.intensity
|
||||||
return {
|
: Number.parseFloat(String(effectParams.intensity));
|
||||||
u_sigma: Math.max(intensity / 5, 0.001),
|
return {
|
||||||
u_direction: [0, 1],
|
u_sigma: Math.max((intensity / 5) * (height / 1080), 0.001),
|
||||||
};
|
u_direction: [0, 1],
|
||||||
},
|
};
|
||||||
},
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user