summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-06-17 15:56:07 -0700
committerMichael Pavone <pavone@retrodev.com>2017-06-17 15:56:07 -0700
commit24af3678b264680a694dc19731eb701b1445bbbb (patch)
treec7d66f27185fe4920042109bb3793e15955e038a
parentbd042662ece40d55466d16221641f67f6975aa77 (diff)
Force texture y-coordinate to middle of line in default shader. Substantially improves picture when linear texture filtering is used
-rw-r--r--shaders/default.f.glsl5
1 files changed, 3 insertions, 2 deletions
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
);
}