Skip to content

Commit 35a782e

Browse files
committed
Fix idiot flare behaviour
1 parent 5a33129 commit 35a782e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/textures.png

110 KB
Loading

src/flitter/render/window/glsl/filter_functions.glsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const vec3[SpectrumSize] SpectrumWeights = vec3[](vec3(0.1, 0.0, 0.3),
3838
vec3 filter_lens_ghost(sampler2D tex, vec2 coord, vec2 size, float distort, float scale, float threshold, float attenuation, float aberration) {
3939
vec2 p = (coord - 0.5) * size;
4040
float r = length(p);
41-
float th = atan(p.y, p.x);
42-
float rmax = max(size.x, size.y) / 2.0;
41+
p /= r;
42+
float rmax = length(size) / 2.0;
4343
r = (1.0 - pow(1.0 - r / rmax, distort)) * rmax / scale;
44-
vec2 q = r * vec2(cos(th), sin(th));
44+
vec2 q = r * p;
4545
float w = clamp(r / rmax, 0.0, 1.0);
4646
w *= w;
4747
w = 1.0 - w;

0 commit comments

Comments
 (0)