From: Angus Dorbie (dorbie++at++sgi.com)
Date: 05/11/2001 09:34:05
You cannot see progress as things are loaded node by node unless you
write your own loader. What you can do is see progress loading file by
file WHILE drawing what's loaded quite smoothly between the introduction
of new files, which is probably good enough for your purposes. The
loaders load a portion of a scene graph and hand it to the app which is
then responsible for adding it to the visible scene, you don't see what
a loader is doing until it is done with a file.
You can load a file and add it in the app, doing this one file at a time
as you draw would be possible, but the problem is that doing this means
that while you load a file the application cannot perform other tasks
and a file takes a relatively long and moderately unpredictable time to
load causing long pauses during loading.
To address this problem Performer provides a database process, this is
an asynchronous loading process which can be passed a file name for
loading (your code would do the passing through shared memory allocated
from the shared arena). The standard loaders are used to build a scene
graph from any supported file format and this will not impact app
performance because it is being done in another process, obviously it
might slow you down if you have to share cpu resources with other
Performer processes. Many iterations of user input and application
processing may happen as a single file is being loaded in another
process.
Once the database process has finished loading a file it passes the
pointer back to the application process through shared memory (your code
would do this). The application (again your code) then makes a call to
merge the loaded nodes into it's list of known objects with a call to
pfMergeBuffer. The newly loaded graph represented by the pointer passed
from the dbase process can then be added to the scene at which time it
will be visible when it propagates to the draw process.
The merge buffers call is relatively lightweight and should not cause
the kinds of problems you'd otherwise see with a naive approach like the
application process calling to load a file. The first time new textures
are used in the draw process you will experience some performance
impact, again much less than loading a fill in the app. You can get
around this by ensuring that each file you load doesn't contain too much
new texture information, or you can attempt the tricky task of passing
textures to the draw process for incremental download to texture memory
before you add the new graph to the scene, the latter would probably
present quite a challenge.
Cheers,ANgus.
John Hasselbaink wrote:
>
> I have already posted this once before and didn't get any answer
>
> I have a large database. I would need code to load it asynchronously.
> What I want is to see the scene while loading it, as nodes are attached to
> it.
> Sample code and a detailed explanation would be very helpful as I don't have
> much experience with Performer. I use Performer on O2 and Linux.
> Could I do async loading of database via Posix threads?
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- For Performer+OpenGL tutorials http://www.dorbie.com/"Whenever there is a conflict between human rights and property rights, human rights must prevail." --Abraham Lincoln
This archive was generated by hypermail 2b29 : Fri May 11 2001 - 09:34:39 PDT