From b036cac6168acba4a14a84f816656021d5137eca Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 23 Feb 2018 02:36:12 +0900 Subject: [PATCH] graphics: Fix screen filter calculation --- internal/graphics/shader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/graphics/shader.go b/internal/graphics/shader.go index 03227ac0e..37eaf9e19 100644 --- a/internal/graphics/shader.go +++ b/internal/graphics/shader.go @@ -162,7 +162,7 @@ void main(void) { vec4 c3 = texture2D(texture, p1); // Texels must be in the source rect, so it is not necessary to check that like linear filter. - vec2 rate = min(max(1.0 - ((1.0 - fract(pos * source_size)) * scale), 0.0), 1.0); + vec2 rate = min(max((fract(pos * source_size) - 0.5) * scale, 0.0), 1.0); vec4 color = mix(mix(c0, c1, rate.x), mix(c2, c3, rate.x), rate.y); #endif