Mercurial > repos > blastem
annotate shaders/sharp.f.glsl @ 1991:7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 13 Jun 2020 00:37:22 -0700 |
parents | f3cca4b3f17a |
children |
rev | line source |
---|---|
1856 | 1 |
2 uniform sampler2D textures[2]; | |
1977
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
3 uniform mediump vec2 texsize; |
1856 | 4 |
5 varying mediump vec2 texcoord; | |
6 | |
7 void main() | |
8 { | |
1977
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
9 mediump float x0 = (floor(texcoord.x * texsize.x - 0.25) + 0.5)/texsize.x; |
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
10 mediump float x1 = (floor(texcoord.x * texsize.x + 0.25) + 0.5)/texsize.x; |
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
11 mediump float y0 = (floor(texcoord.y * texsize.y + 0.25) + 0.5)/texsize.y; |
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
12 mediump float y1 = (floor(texcoord.y * texsize.y - 0.25) + 0.5)/texsize.y; |
1856 | 13 |
1977
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
14 mediump float ymix = (sin(texcoord.y * texsize.y * 6.283185307) + 1.0) * 0.5; |
f3cca4b3f17a
Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents:
1856
diff
changeset
|
15 mediump float xmix = (sin(texcoord.x * texsize.x * 6.283185307) + 1.0) * 0.5; |
1856 | 16 gl_FragColor = mix( |
17 mix( | |
18 texture2D(textures[1], vec2(x0, y1)), | |
19 texture2D(textures[0], vec2(x0, y0)), | |
20 ymix | |
21 ), | |
22 mix( | |
23 texture2D(textures[1], vec2(x1, y1)), | |
24 texture2D(textures[0], vec2(x1, y0)), | |
25 ymix | |
26 ), | |
27 xmix | |
28 ); | |
29 } |