Skip to content

Commit a74b669

Browse files
committed
Merge branch 'linearbloom' into 'master'
Avoid negative base pow UB in linear bloom See merge request OpenMW/openmw!4702
2 parents 1fff2f0 + 7113cef commit a74b669

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)