From 7113cef501d24f5de61f41db2ce49a17567a5e85 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 2 Jun 2025 00:59:32 +0300 Subject: [PATCH] Avoid negative x pow UB in linear bloom --- files/data/shaders/bloomlinear.omwfx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/data/shaders/bloomlinear.omwfx b/files/data/shaders/bloomlinear.omwfx index 4c583a9a89..c3e298772a 100644 --- a/files/data/shaders/bloomlinear.omwfx +++ b/files/data/shaders/bloomlinear.omwfx @@ -80,8 +80,9 @@ shared { radius = max(radius, 0.1); // hack: make the radius wider on the screen edges // (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs) - radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0; - radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0; + texcoord = texcoord * 2.0 - vec2(1.0); + radius *= texcoord.x * texcoord.x + 1.0; + radius *= texcoord.y * texcoord.y + 1.0; return radius; } vec3 powv(vec3 a, float x)