Bernie Kirby (bernie++at++iii.rmit.edu.au)
Tue, 20 Jul 1999 14:38:06 +1000 (EST)
First problem:
My problem is that we want to have a movie texture, that is
a movie file as a changing texture on a bit of geometry. That in
itself isn't much of a problem, I just opened the movie file (mvOpenFile)
allocate some mem for the image with pfMalloc(...) and
setup a new texture with all the usual pfTexFormat, pfTexFilter,
and pfTexLoadModes thus:
pfTexFilter(mv->tex, PFTEX_MINFILTER, PFTEX_LINEAR);
pfTexFilter(mv->tex, PFTEX_MAGFILTER, PFTEX_LINEAR);
pfTexFormat(mv->tex, PFTEX_SUBLOAD_FORMAT, PF_ON);
pfTexFormat(mv->tex, PFTEX_INTERNAL_FORMAT, PFTEX_RGB);
pfTexFormat(mv->tex, PFTEX_EXTERNAL_FORMAT, PFTEX_PACK_8);
pfTexLoadMode(mv->tex, PFTEX_LOAD_BASE, PFTEX_BASE_AUTO_SUBLOAD);
pfTexLoadMode(mv->tex, PFTEX_LOAD_SOURCE, PFTEX_SOURCE_IMAGE);
pfTexLoadOrigin(mv->tex, PFTEX_ORIGIN_DEST, xoff, 0);
pfTexLoadSize(mv->tex, mv->w, mv->h);
pfTexImage(mv->tex, mv->img, 4, mv->tw, mv->th, 0);
Then I can mvRenderMovieToImageBuffer(....)
into the image when I want the movie texture updated. It mainly works
quite well, however, when one is close to (as in viewing them from a
relatively close distance in the scene) the polygon(s) that this
texture is applied to, the texture disappears, sometimes other viewpoints
seemingly cause the texture to magically 'go away'.
On a 3 pipe machine, the texture disappears at different times depending
on the view in each pipe.
I suspected texture paging at first, bit it happens on a trivial test
scene as well.
What on earth could the cause of all this?
I also tried the frame buffer as a texture source with
pfSubloadTex(pffbtex, PFTEX_SOURCE_FRAMEBUFFER, NULL, 0, 0, 0, 0, 0, 1024, 1024);
which also works quite well, but again , it suffers from the magic
disappearing.
Second problem:
I was considering using dmBuffers for the movies, but I'm confused
as to what will happen on in a Multiprocessed, Multipipe situation with
independent DRAW/CULL procs for each pipe. As the dmedia lib allocates
the dmBuffers, and I read that you should do this from the DRAW proc,
how does one rationalize this with the fact that I now have 3 DRAW procs?
I initally gave up on the dmBuffers as I couldn't figure out
an easy way to have the dmBuffer shared between the procs without initialising
it all before pfConfig
There is a scant reference in the insight books to
PFTEX_SOURCE_DMBUFF, but one would still have to share this data
amonst the procs anyway wouldn't one?
One last question: with the PFTEX_SOURCE_FRAMEBUFFER textures, and
multipipe/screen machines, which framebuffer is it going to use?
This archive was generated by hypermail 2.0b2 on Mon Jul 19 1999 - 21:38:20 PDT