From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 07/09/2003 15:11:19
Hello Jose !
> My goal is to animate a series of textures (about 10,000 textures, about 5G)
> on a RAVE display. Given texture memory limitations, I would like to load
> textures and deallocate texure memory (e.g. delete 1,000 textures at a time
> after displayed). Is there any straight foward way of doing this.
Deleting and re-allocating textures is wasteful and won't run very fast. I
assume all your textures are of the same size and internal/external formats. I
would define a small set of pfTextures and subload new contents into their
OpenGL texture images every frame.
Take a look at the man page for pfTexture::subload (or pfSubloadTex) for more
information.
Also, take a look at the sample program:
/usr/share/Performer/src/pguide/libpr/C/texlist.c
It animates textures on an object (the way you would like to, I think).
> If I do something as simple as:
> while(1)
> {
> tex = new pfTexture();
> tex->load("file.rgb");
> pfDelete(tex);
> }
> Memory is never released and the simple example would eventually exhaust all memory and exit. How is memory released in this example???
Performer doesn't delete objects as soon as you call pfDelete. When you call
pfDelete, Performer queues your delete request for later deletion. The real
deletion happens after all the DRAW processes finish processing the frame where
you called pfDelete. So, a few (around 3) calls to pfFrame later, Performer
deletes your object.
Things are a bit more complicated with textures because a pfTexture creates
an OpenGL texture in the DRAW process. You can not delete the OpenGL texture
from any other process. Take a look at the sample code:
/usr/share/Performer/src/pguide/libpf/C/deleteTBox.c
This code demonstrates how to delete the OpenGL texture that a pfTexture
contains.
-yair
--
\_________ \_____ \__ \__ \_____
\_________ \_____ \__ \__ \_____ Yair Kurzion
\__ \__ \____\__ \__ yair++at++sgi.com
\__ \__ \__ (650) 933-6502
\__ \__ \__
\__ \__ \__
This archive was generated by hypermail 2b29 : Wed Jul 09 2003 - 15:11:47 PDT