From 24af3678b264680a694dc19731eb701b1445bbbb Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 17 Jun 2017 15:56:07 -0700 Subject: Force texture y-coordinate to middle of line in default shader. Substantially improves picture when linear texture filtering is used --- shaders/default.f.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shaders') diff --git a/shaders/default.f.glsl b/shaders/default.f.glsl index d5eabf6..efc570d 100644 --- a/shaders/default.f.glsl +++ b/shaders/default.f.glsl @@ -6,9 +6,10 @@ varying vec2 texcoord; void main() { + vec2 modifiedCoord = vec2(texcoord.x, (floor(texcoord.y * 512.0) + 0.5)/512.0); gl_FragColor = mix( - texture2D(textures[0], texcoord), - texture2D(textures[1], vec2(texcoord.x, texcoord.y - 0.5/1024.0)), + texture2D(textures[0], modifiedCoord), + texture2D(textures[1], modifiedCoord), (sin((texcoord.y * 1024.0 + 1.0)* 3.14159265359) + 1.0) * 0.5 ); } -- cgit v1.2.3