Andreas.Lenz++at++esg.de
Date: 09/03/2003 01:08:13
Hi folks,
I'm still working on a terrain visualisation for a flight simulation, which
uses a paging
process to load terrain tiles dynamically into the scene. Typically there
are 9 (+-3)
tiles paged at the same time. Tiles are loaded as .pfb files, which are
each about
3MB large - textures not included. As an average 3 tiles are loaded and
should be
deleted avery 30 seconds.
When i try to delete tiles in my database function, the call to pfDBase
takes very much
time - especially when i try to delete more tiles at the same time. Delays
may last for a
minute or more.
I tried to remove the tile-nodes from the scene without deleting them and
there were no
delays, of course until the memory of the shared arena was used. But it
showed that
loading of the tiles was not the problem, just the deletion.
The application is build on the perfly source code.
I programmed the database function following the example in the pfBuffer
man pages
using the C++ API, which looks basically like:
pfNode **Tiles; //allocated in main()
void myDBaseFunc (void)
{
bool changed = false;
static pfBuffer *Buffer = NULL;
if (Buffer == NULL)
Buffer = new pfBuffer;
Buffer->select();
if (Tiles[index] should be paged)
{
Tiles[index] = pfdLoadFile(file); // which is a .pfb
Shared->scene->bufferAddChild ( Tiles[index] );
changed = true;
}
if (Tiles[index] should be removed)
{
Shared->scene->bufferRemoveChild( Tiles[index] );
pfAsyncDelete( Tiles[index] );
changed = true;
}
if( changed )
Buffer->merge();
pfDBase();
}
I wonder what might cause the long delay in the call to pfDBase().
What I'm not sure about is, if a delete the tiles correctly. Especially
I'm not sure what happens to textures. As far as i understand textures
are loaded whith the above call Tiles[index] = pfdLoadFile("myTile.pfb").
Of course several tiles use the same textures. Are the textures shared
and what happens to them if i try to delete a tile ? Do i have to delete
the textures explicit ?
Would it be possible to put all the textures i might use in a .flt file
which i could load at program start ?
Any help on the correct way of deleting unused tiles (and textures) is
welcome. Is there any sample code, which handles this problem ?
I also thought about, that the problem might be related to the hardware.
I'm running the application on a Dual-Xeon (2x2 GHz) with activated
hyper-threading, SUSE-Linux 8.2, smp-kernel 2.4.20, GeForce4 Ti4600 with
latest NVIDIA drivers, XFree 4.3.
I tried perfomer versions 2.5 and 3.0.2 with no difference.
Thanks for your help,
Andreas Lenz
------------------------------------------------------------
Andreas Lenz ESG GmbH
Einsteinstrasse 174 D-81675 München
Tel.: ++49-89-9216-2167
Fax.: ++49-89-9216-2632
Mail: Andreas.Lenz++at++esg.de
------------------------------------------------------------
This archive was generated by hypermail 2b29 : Wed Sep 03 2003 - 01:12:29 PDT