File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,7 @@ bool BorderMaskBlurFilterContents::RenderFilter(
92
92
93
93
VS::FrameInfo frame_info;
94
94
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 () /
98
96
input_snapshot->texture ->GetSize ();
99
97
frame_info.src_factor = src_color_factor_;
100
98
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;
33
33
34
34
// Indefinite integral of the Gaussian function (with constant range 0->1).
35
35
float 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 ;
37
40
}
38
41
39
42
float BoxBlurMask(vec2 uv) {
You can’t perform that action at this time.
0 commit comments