no more blur glitches

This commit is contained in:
Yoshman29
2023-03-17 00:35:58 +01:00
parent 091d0e9d10
commit 6a527ccf20
2 changed files with 12 additions and 3 deletions
+11 -2
View File
@@ -4,13 +4,22 @@
int steps = 16;
int stepsInside = 2;
float strength = 0.0075;
vec4 getColor(vec2 pos) {
if (pos.x < 0) pos.x = 0;
else if (pos.x > 1.0 - (1.0 / openfl_TextureSize.x)) pos.x = 1.0 - (1.0 / openfl_TextureSize.x);
if (pos.y < 0) pos.y = 0;
else if (pos.y > 1.0 - (1.0 / openfl_TextureSize.y)) pos.y = 1.0 - (1.0 / openfl_TextureSize.y);
return textureCam(bitmap, pos);
}
void main() {
vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);
vec2 camPos = getCamPos(openfl_TextureCoordv);
vec4 color = getColor(camPos);
float fsteps = steps;
for(float inside = 1; inside < stepsInside+1; inside++) {
for(int i = 0; i < steps; i++) {
float fi = i;
color += flixel_texture2D(bitmap, openfl_TextureCoordv + vec2(strength * (inside / stepsInside) * cos(fi / fsteps * (PI * 2.0)), strength * (inside / stepsInside) * sin(fi / fsteps * (PI * 2.0))));
color += getColor(camPos + vec2(strength * (inside / stepsInside) * cos(fi / fsteps * (PI * 2.0)), strength * (inside / stepsInside) * sin(fi / fsteps * (PI * 2.0))));
}
}
+1 -1
View File
@@ -1 +1 @@
2551
2552