[MPlayer-dev-eng] gl & distorted fisheye for dome projection
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jul 8 21:33:53 CEST 2006
Hello,
On Wed, Jul 05, 2006 at 10:51:11PM +0200, Johannes Gajdosik wrote:
> I tried your new patch.
>
> 1) with my old 16bit/pixel ppm: No effect,
> the image is the same as when specify an inexisting texture.
Your card does not support the ARB extension, only the significantly
less powerful nVidia special-case extension.
> I wonder what is going wrong. I even used ARB_precision_hint_nicest because I
> have read ARB_precision_hint_fastest will make 16-bit-floats. No success.
That will probably make no real difference.
Update to latest SVN and use attached version (pay attention to the
changed commandline!).
Main advantage is that the same customtex can be used for any video as
long as the aspect matches monitor aspect (can be achieved via -vf expand
if needed).
It also means your old customtex will not work (you can get a working
one by creating one for a 1024x1024 video).
Be aware that on your hardware the floating point texture will not be
interpolated, so make customtex accordingly big.
Also, for your other programs where linear interpolation is bad you
should add the "nocustomtlin" suboption.
Greetings,
Reimar Döffinger
-------------- next part --------------
!!ARBfp1.0
# distort.fp, Author and Copyright Johannes Gajdosik, 2006
# Licensed under the GNU GPL v2
# Many thanks to the kind assistance of Reimar Doeffinger.
# This program distorts the image according to an index-texture.
# The r/g-values of this texture give the x/y position that is used
# for lookup in the image texture.
# The b-value is used for brightness reduction: maximum value means no
# brightness reduction, 0 means reduction to black.
# Usage: mplayer -vo gl:yuv=2:customprog=/path/distort.fp:customtex=/path/index.ppm:customtrect:rectangle=1
TEMP tmp, y, u, v, pos, pos2;
# Get "screen" coordinates in [0,1] range
MUL tmp.xy, fragment.texcoord[0].xyxy, program.env[0].xyxy;
# Scale to RECT coordinates for lookup texture
MUL tmp.xy, tmp.xyxy, program.env[1].zwzw;
# lookup the position/brightness in the index texture
TEX pos.rgb, tmp, texture[3], RECT;
#Scale to RECT coordinates for display texture
MUL pos.xy, pos.xyxy, program.env[0].zwzw;
# now do the normal YUV -> RGB conversion for point at position pos,
# this part is derived from edgdetect.fp by Reimar Doeffinger
TEX y.r, pos, texture[0], RECT;
MAD tmp.rgb, y.rrrr, {1.164, 1.164, 1.164, 0}, {-0.87416, 0.53133, -1.08599, 0};
MUL pos.xy, pos.xyxy, {0.5, 0.5}; # Coordinates for UV textures
TEX u.r, pos, texture[1], RECT;
MAD tmp.gb, u.rrrr, {0, -0.391, 2.018, 0}, tmp;
TEX v.r, pos, texture[2], RECT;
MAD tmp.rg, v.rrrr, {1.596, -0.813, 0, 0}, tmp;
# scale by brightness
MUL result.color.rgb, pos.bbbb, tmp;
END
More information about the MPlayer-dev-eng
mailing list