Skip to content

Commit 7113cef

Browse files
committed
Avoid negative x pow UB in linear bloom
1 parent 0c6c71f commit 7113cef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

files/data/shaders/bloomlinear.omwfx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ shared {
8080
radius = max(radius, 0.1);
8181
// hack: make the radius wider on the screen edges
8282
// (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)
83-
radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0;
84-
radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0;
83+
texcoord = texcoord * 2.0 - vec2(1.0);
84+
radius *= texcoord.x * texcoord.x + 1.0;
85+
radius *= texcoord.y * texcoord.y + 1.0;
8586
return radius;
8687
}
8788
vec3 powv(vec3 a, float x)

0 commit comments

Comments
 (0)