summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-07-07 21:44:49 -0700
committerMichael Pavone <pavone@retrodev.com>2017-07-07 21:44:49 -0700
commit3b9d676e5bc08488d54b2479201ede060f727b68 (patch)
treef161219df5b050fb0ace40a56bace5636943aaa1
parent2c260adf268e668038b500e26e1efaed54caa3fb (diff)
Fix texture coordinate offsets in default shader so things look right with really high resolutions and weird multiples of native
-rw-r--r--shaders/default.f.glsl7
1 files changed, 4 insertions, 3 deletions
diff --git a/shaders/default.f.glsl b/shaders/default.f.glsl
index 18c911d..3427e09 100644
--- a/shaders/default.f.glsl
+++ b/shaders/default.f.glsl
@@ -6,10 +6,11 @@ varying vec2 texcoord;
void main()
{
- vec2 modifiedCoord = vec2(texcoord.x, (floor(texcoord.y * 512.0) + 0.5)/512.0);
+ vec2 modifiedCoord0 = vec2(texcoord.x, (floor(texcoord.y * 512.0 + 0.25) + 0.5)/512.0);
+ vec2 modifiedCoord1 = vec2(texcoord.x, (floor(texcoord.y * 512.0 - 0.25) + 0.5)/512.0);
gl_FragColor = mix(
- texture2D(textures[1], modifiedCoord),
- texture2D(textures[0], modifiedCoord),
+ texture2D(textures[1], modifiedCoord1),
+ texture2D(textures[0], modifiedCoord0),
(sin(texcoord.y * 1024.0 * 3.14159265359) + 1.0) * 0.5
);
}