diff --git a/engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc b/engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc index 328f7d78e3..a14e2da07f 100644 --- a/engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc +++ b/engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc @@ -92,9 +92,7 @@ bool BorderMaskBlurFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(ISize(1, 1)); - auto scale = entity.GetTransformation().GetScale(); - frame_info.sigma_uv = Vector2(scale.x, scale.y) * - Vector2(sigma_x_.sigma, sigma_y_.sigma).Abs() / + frame_info.sigma_uv = Vector2(sigma_x_.sigma, sigma_y_.sigma).Abs() / input_snapshot->texture->GetSize(); frame_info.src_factor = src_color_factor_; frame_info.inner_blur_factor = inner_blur_factor_; diff --git a/engine/src/flutter/impeller/entity/shaders/border_mask_blur.frag b/engine/src/flutter/impeller/entity/shaders/border_mask_blur.frag index 365d9eaa10..4c018bf3ad 100644 --- a/engine/src/flutter/impeller/entity/shaders/border_mask_blur.frag +++ b/engine/src/flutter/impeller/entity/shaders/border_mask_blur.frag @@ -33,7 +33,10 @@ const float kHalfSqrtTwo = 0.70710678118; // Indefinite integral of the Gaussian function (with constant range 0->1). float GaussianIntegral(float x, float sigma) { - return 0.5 + 0.5 * erf(x * (kHalfSqrtTwo / sigma)); + // ( 1 + erf( x * (sqrt(2) / (2 * sigma) ) ) / 2 + // Because this sigmoid is always > 1, we remap it (n * 1.07 - 0.07) + // so that it always fades to zero before it reaches the blur radius. + return 0.535 * erf(x * (kHalfSqrtTwo / sigma)) + 0.465; } float BoxBlurMask(vec2 uv) {