File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,7 @@ bool BorderMaskBlurFilterContents::RenderFilter(
9292
9393 VS::FrameInfo frame_info;
9494 frame_info.mvp = Matrix::MakeOrthographic (ISize (1 , 1 ));
95- auto scale = entity.GetTransformation ().GetScale ();
96- frame_info.sigma_uv = Vector2 (scale.x , scale.y ) *
97- Vector2 (sigma_x_.sigma , sigma_y_.sigma ).Abs () /
95+ frame_info.sigma_uv = Vector2 (sigma_x_.sigma , sigma_y_.sigma ).Abs () /
9896 input_snapshot->texture ->GetSize ();
9997 frame_info.src_factor = src_color_factor_;
10098 frame_info.inner_blur_factor = inner_blur_factor_;
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ const float kHalfSqrtTwo = 0.70710678118;
3333
3434// Indefinite integral of the Gaussian function (with constant range 0->1).
3535float GaussianIntegral(float x, float sigma) {
36- return 0.5 + 0.5 * erf(x * (kHalfSqrtTwo / sigma));
36+ // ( 1 + erf( x * (sqrt(2) / (2 * sigma) ) ) / 2
37+ // Because this sigmoid is always > 1, we remap it (n * 1.07 - 0.07)
38+ // so that it always fades to zero before it reaches the blur radius.
39+ return 0.535 * erf(x * (kHalfSqrtTwo / sigma)) + 0.465 ;
3740}
3841
3942float BoxBlurMask(vec2 uv) {
You can’t perform that action at this time.
0 commit comments