Skip to content

Commit 99f6b3d

Browse files
committed
Limit zoom blur offset and scale by distance
1 parent 381fed6 commit 99f6b3d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/rendering/src/shaders/composite-video-frame.wgsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ fn fs_main(@builtin(position) frag_coord: vec4<f32>) -> @location(0) vec4<f32> {
184184
return mix(shadow_color, base_color, base_color.a);
185185
}
186186

187-
let scaled_dir = dir * blur_strength;
187+
let max_zoom_offset = 0.12;
188+
let zoom_scale = min(zoom_amount, 1.0);
189+
let scaled_dir = dir / dist * min(dist * zoom_scale, max_zoom_offset);
188190
let max_kernel = 13.0;
189191

190192
let offset_rand = rand(vec2<f32>(target_uv.x * 7.37, target_uv.y * 11.23));

0 commit comments

Comments
 (0)