[MPlayer-dev-eng] gl & distorted fisheye for dome projection

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jun 29 23:06:17 CEST 2006


Hello,
On Thu, Jun 29, 2006 at 10:49:35PM +0200, Johannes Gajdosik wrote:
> So if I understand correctly, the only thing I need to make is a
> "custom fragment program" and a "custom texture". Or perhaps
> rather a program that generates the "custom fragment program" and
> the "custom texture" from the image sizes and the geometry parameters.

Ideally, the custom fragment program will stay the same in all cases,
and the texture will only change for different "hardware" (i.e. mirror
etc) setups. Though for starting making the texture depend on more will
be easier.

> I have had a look at the manpage and at edgedetect.fp and emboss.fp.
> And I must admit that I did not understand the fragment programs
> well enough in order to be able to write my own. Some lines I could
> not understand at all.
> Can you give me a hint where to acquire the knowledge needed to
> write a fragment program that accomplishes this task?

Specification is here:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt
But don't worry, I can help you out there, I don't think it should be
too much of an effort.
If you want to try this approach, start with a little program that
creates the texture (sizes must be power of two, in PPM format).
For starting it would be simplest if you use the next power of two of
the movie as width and height of the texture.
Then, the red and green values would be pointers to the texture pixel to use for
that output pixel (since they are numbers between 0 and 255, the formula
would be 255 * (source coordinate / texture dimension)).
And I'd use the blue value for the brightness (again, from 0 to 255, 0
stands for black, 255 for original color).
I can then write you (at least a basic version of) the fragment program.

> For an easy alternative: Are plugins possible in mplayer? In this case I
> think of a special vo plugin of course. The pluging would not have to be
> distributed along with mplayer, and it would not have to be maintained
> by mplayer developers.

No, only possibility is to maintain a sourcecode patch.

Greetings,
Reimar Doeffinger



More information about the MPlayer-dev-eng mailing list