in24/in32/fl32 little/big-endian QuickTime PCM audio support
[mplayer/glamo.git] / TOOLS / emboss.fp
bloba8ca611aae0d0785d2b7d9405c40a99c9aa7d945
1 !!ARBfp1.0
2 # Custom YUV->RGB conversion program for MPlayer's -vo gl.
3 # Copyleft (C) Reimar Döffinger, 2005
4 # Licensed under the GNU GPL v2
5 # Usage: mplayer -vo gl:yuv=4:customprog=emboss.fp
6 # This is an emboss effect.
7 PARAM sizes = program.env[0];
8 TEMP res, y, u, v, xdiff, ydiff, pos, tmp;
9 TEX y, fragment.texcoord[0], texture[0], 2D;
10 SUB pos, fragment.texcoord[0], sizes.xwww;
11 TEX tmp, pos, texture[0], 2D;
12 SUB xdiff, y, tmp;
13 MAD xdiff, xdiff, {0.5, 0.5, 0.5, 0}, {0.5, 0.5, 0.5, 0};
14 SUB pos, fragment.texcoord[0], sizes.wyww;
15 TEX tmp, pos, texture[0], 2D;
16 SUB ydiff, y, tmp;
17 MAD res, ydiff, {0.8660, 0.8660, 0.8660, 0}, xdiff;
18 # now do the normal YUV -> RGB conversion
19 MAD res, res, {1.164, 1.164, 1.164, 0}, {-0.87416, 0.53133, -1.08599, 0};
20 TEX u, fragment.texcoord[1], texture[1], 2D;
21 MAD res, u, {0, -0.391, 2.018, 0}, res;
22 TEX v, fragment.texcoord[2], texture[2], 2D;
23 MAD res, v, {1.596, -0.813, 0, 0}, res;
24 # do gamma texture lookup
25 ADD res.a, res.a, 0.125;
26 TEX res.r, res.raaa, texture[3], 2D;
27 ADD res.a, res.a, 0.25;
28 TEX res.g, res.gaaa, texture[3], 2D;
29 ADD res.a, res.a, 0.25;
30 TEX res.b, res.baaa, texture[3], 2D;
31 # move res into result, this allows easily commenting out some parts.
32 ADD result.color, res, {0, 0, 0, 0};
33 END