File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ in vec2 TexCoord;
5
5
layout (location = 0 ) out vec4 FragColor;
6
6
7
7
uniform sampler2D texture0;
8
- uniform float stepAngle;
9
8
uniform int quality;
10
9
uniform vec2 resolution;
11
10
uniform vec2 pivot;
@@ -17,13 +16,21 @@ void main() {
17
16
vec2 uv1 = (TexCoord * resolution - pivot) * rPos;
18
17
vec2 uv2 = uv1;
19
18
vec4 color = texture(texture0, clamp ((uv1 + pivot) / resolution, 0 , 1 ));
19
+ color.rgb *= color.a;
20
20
21
21
for (int i = 1 ; i <= quality; i++ ){
22
22
uv1 *= rot1;
23
- color += texture(texture0, clamp ((uv1 + pivot) / resolution, 0 , 1 ));
23
+ vec4 c = texture(texture0, clamp ((uv1 + pivot) / resolution, 0 , 1 ));
24
+ c.rgb *= c.a;
25
+ color += c;
24
26
25
27
uv2 *= rot2;
26
- color += texture(texture0, clamp ((uv2 + pivot) / resolution, 0 , 1 ));
28
+ c = texture(texture0, clamp ((uv2 + pivot) / resolution, 0 , 1 ));
29
+ c.rgb *= c.a;
30
+ color += c;
27
31
}
28
- FragColor = color / (quality * 2 + 1 );
32
+
33
+ color.rgb /= color.a;
34
+ color.a /= quality * 2 + 1 ;
35
+ FragColor = color;
29
36
}
You can’t perform that action at this time.
0 commit comments