Skip to content

Commit a39bd7f

Browse files
author
xufuji456
committed
feat: rename param
1 parent dd9a26f commit a39bd7f

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

CameraFilter/src/main/res/raw/zoomblur.glsl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ uniform highp float blurSize;
77

88
void main()
99
{
10-
// TODO: Do a more intelligent scaling based on resolution here
10+
1111
highp vec2 samplingOffset = 1.0/100.0 * (blurCenter - textureCoordinate) * blurSize;
1212

13-
lowp vec4 fragmentColor = texture2D(inputImageTexture, textureCoordinate) * 0.18;
14-
fragmentColor += texture2D(inputImageTexture, textureCoordinate + samplingOffset) * 0.15;
15-
fragmentColor += texture2D(inputImageTexture, textureCoordinate + (2.0 * samplingOffset)) * 0.12;
16-
fragmentColor += texture2D(inputImageTexture, textureCoordinate + (3.0 * samplingOffset)) * 0.09;
17-
fragmentColor += texture2D(inputImageTexture, textureCoordinate + (4.0 * samplingOffset)) * 0.05;
18-
fragmentColor += texture2D(inputImageTexture, textureCoordinate - samplingOffset) * 0.15;
19-
fragmentColor += texture2D(inputImageTexture, textureCoordinate - (2.0 * samplingOffset)) * 0.12;
20-
fragmentColor += texture2D(inputImageTexture, textureCoordinate - (3.0 * samplingOffset)) * 0.09;
21-
fragmentColor += texture2D(inputImageTexture, textureCoordinate - (4.0 * samplingOffset)) * 0.05;
13+
lowp vec4 blurColor = texture2D(inputImageTexture, textureCoordinate) * 0.18;
14+
blurColor += texture2D(inputImageTexture, textureCoordinate + samplingOffset) * 0.15;
15+
blurColor += texture2D(inputImageTexture, textureCoordinate + (2.0 * samplingOffset)) * 0.12;
16+
blurColor += texture2D(inputImageTexture, textureCoordinate + (3.0 * samplingOffset)) * 0.09;
17+
blurColor += texture2D(inputImageTexture, textureCoordinate + (4.0 * samplingOffset)) * 0.05;
18+
blurColor += texture2D(inputImageTexture, textureCoordinate - samplingOffset) * 0.15;
19+
blurColor += texture2D(inputImageTexture, textureCoordinate - (2.0 * samplingOffset)) * 0.12;
20+
blurColor += texture2D(inputImageTexture, textureCoordinate - (3.0 * samplingOffset)) * 0.09;
21+
blurColor += texture2D(inputImageTexture, textureCoordinate - (4.0 * samplingOffset)) * 0.05;
2222

23-
gl_FragColor = fragmentColor;
23+
gl_FragColor = blurColor;
2424
}

0 commit comments

Comments
 (0)