/usr/share/openmsx/shaders/hqlite.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 | // $Id: hqlite.frag 10788 2009-11-16 15:34:07Z m9710797 $
uniform sampler2D edgeTex;
uniform sampler2D colorTex;
uniform sampler2D offsetTex;
uniform sampler2D videoTex;
varying vec2 leftTop;
varying vec2 edgePos;
varying vec4 misc;
varying vec2 videoCoord;
void main()
{
float edgeBits = texture2D(edgeTex, edgePos).x;
//gl_FragColor = vec4(edgeBits, fract(edgeBits * 16.0), fract(edgeBits * 256.0), 1.0);
// transform (N x N x 4096) to (64N x 64N) texture coords
float t = 64.0 * edgeBits;
vec2 xy = vec2(fract(t), floor(t)/64.0);
vec2 subPixelPos = misc.xy;
xy += fract(subPixelPos) / 64.0;
vec2 offset = texture2D(offsetTex, xy).xw;
// fract not really needed, but it eliminates one MOV instruction
vec2 texStep2 = fract(misc.zw);
vec4 col = texture2D(colorTex, leftTop + offset * texStep2);
#if SUPERIMPOSE
vec4 vid = texture2D(videoTex, videoCoord);
gl_FragColor = mix(vid, col, col.a);
#else
gl_FragColor = col;
#endif
}
|