diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-25 16:47:22 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:48:22 +0200 |
| commit | 8db3bead13441a5882d8689dfc6a9f09c82375d9 (patch) | |
| tree | e9d0cafa93904ffcbec3188c37961bcc16c6422d /apps/web/src/lib/effects/definitions/blur.frag.glsl | |
| parent | 39ea298a9ccba3104c549c0ca079c231981811f5 (diff) | |
| download | opencut-8db3bead13441a5882d8689dfc6a9f09c82375d9.tar.gz | |
feat: masks, properties refactor, shaders, storage migrations, and more
Diffstat (limited to 'apps/web/src/lib/effects/definitions/blur.frag.glsl')
| -rw-r--r-- | apps/web/src/lib/effects/definitions/blur.frag.glsl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/web/src/lib/effects/definitions/blur.frag.glsl b/apps/web/src/lib/effects/definitions/blur.frag.glsl index 2c015725..c9ad2eae 100644 --- a/apps/web/src/lib/effects/definitions/blur.frag.glsl +++ b/apps/web/src/lib/effects/definitions/blur.frag.glsl @@ -3,6 +3,7 @@ precision mediump float; uniform sampler2D u_texture; uniform vec2 u_resolution; uniform float u_sigma; +uniform float u_step; uniform vec2 u_direction; varying vec2 v_texCoord; @@ -13,13 +14,12 @@ void main() { vec4 color = vec4(0.0); float totalWeight = 0.0; - // step=1 texel — scaling step size instead causes discrete ghosting artifacts for (int i = -30; i <= 30; i++) { - float fi = float(i); - float weight = exp(-(fi * fi) / (2.0 * u_sigma * u_sigma)); - color += texture2D(u_texture, v_texCoord + texelSize * u_direction * fi) * weight; + float pos = float(i) * u_step; + float weight = exp(-(pos * pos) / (2.0 * u_sigma * u_sigma)); + color += texture2D(u_texture, v_texCoord + texelSize * u_direction * pos) * weight; totalWeight += weight; } gl_FragColor = color / totalWeight; -} +}
\ No newline at end of file |
