Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/rendering/src/shaders/composite-video-frame.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ fn sample_texture(uv: vec2<f32>, crop_bounds_uv: vec4<f32>) -> vec4<f32> {
}

fn apply_rounded_corners(current_color: vec4<f32>, target_uv: vec2<f32>) -> vec4<f32> {
// Compute the signed distance to the rounded rect in pixel space so we can
// blend edges smoothly instead of hard-clipping them (which produced jaggies).
if uniforms.rounding_px < 0.5 {
return current_color;
}

let centered_uv = (target_uv - vec2<f32>(0.5)) * uniforms.target_size;
let half_size = uniforms.target_size * 0.5;
let distance = sdf_rounded_rect(centered_uv, half_size, uniforms.rounding_px, uniforms.rounding_type);
Expand Down
Loading