Mercurial > repos > blastem
comparison shaders/default.f.glsl @ 1426:957325c990d5
Fix texture coordinate offsets in default shader so things look right with really high resolutions and weird multiples of native
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 07 Jul 2017 21:44:49 -0700 |
parents | 5e4a2ea8219b |
children | fa9ae059e4d3 |
comparison
equal
deleted
inserted
replaced
1425:49d3c572b3f2 | 1426:957325c990d5 |
---|---|
4 | 4 |
5 varying vec2 texcoord; | 5 varying vec2 texcoord; |
6 | 6 |
7 void main() | 7 void main() |
8 { | 8 { |
9 vec2 modifiedCoord = vec2(texcoord.x, (floor(texcoord.y * 512.0) + 0.5)/512.0); | 9 vec2 modifiedCoord0 = vec2(texcoord.x, (floor(texcoord.y * 512.0 + 0.25) + 0.5)/512.0); |
10 vec2 modifiedCoord1 = vec2(texcoord.x, (floor(texcoord.y * 512.0 - 0.25) + 0.5)/512.0); | |
10 gl_FragColor = mix( | 11 gl_FragColor = mix( |
11 texture2D(textures[1], modifiedCoord), | 12 texture2D(textures[1], modifiedCoord1), |
12 texture2D(textures[0], modifiedCoord), | 13 texture2D(textures[0], modifiedCoord0), |
13 (sin(texcoord.y * 1024.0 * 3.14159265359) + 1.0) * 0.5 | 14 (sin(texcoord.y * 1024.0 * 3.14159265359) + 1.0) * 0.5 |
14 ); | 15 ); |
15 } | 16 } |