/usr/share/openmsx/shaders/scale2x.frag is in openmsx-data 0.8.2-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | // $Id: scale2x.frag 10791 2009-11-16 15:39:36Z m9710797 $
// Scale2x scaler.
uniform sampler2D tex;
uniform sampler2D videoTex;
varying vec2 texStep; // could be uniform
varying vec2 coord2pi;
varying vec2 videoCoord;
vec4 scaleNx()
{
vec4 delta;
delta.xw = sin(coord2pi) * texStep;
delta.yz = vec2(0.0);
vec4 posLeftTop = gl_TexCoord[0].stst - delta;
vec4 posRightBot = gl_TexCoord[0].stst + delta;
vec4 left = texture2D(tex, posLeftTop.xy);
vec4 top = texture2D(tex, posLeftTop.zw);
vec4 right = texture2D(tex, posRightBot.xy);
vec4 bot = texture2D(tex, posRightBot.zw);
if (dot(left.rgb - right.rgb, top.rgb - bot.rgb) == 0.0 || left.rgb != top.rgb) {
return texture2D(tex, gl_TexCoord[0].st);
} else {
return top;
}
}
void main()
{
#if SUPERIMPOSE
vec4 col = scaleNx();
vec4 vid = texture2D(videoTex, videoCoord);
gl_FragColor = mix(vid, col, col.a);
#else
gl_FragColor = scaleNx();
#endif
}
|