RE: How to delete a graph?

New Message Reply Date view Thread view Subject view Author view

José María López (jmlopez++at++espelsa.es)
Tue, 29 Sep 1998 19:43:39 +0200


OK!
But do you know if that can be done in a Octane drawing two channels at
10-15 Hz?
Maybe I want to run too much in my Octane:
I need to run a VR environment in a Octane MXE with a R10000 250MHz and two
channels, because I need to draw a view for a HMD (no stereoscopic) and a
interactive window for the instructor site. I need to run sequences like
pfSequence and pre-saved video like dynamical textures. My problem is that I
only have 4 Mb for textures, and I don't know how to resolve it. I only know
two options:

load/unload parts of my graph in real time, but I am doubtful that is
possible only with one CPU.

load all nodes at the beginning and build a scene with switchs to change
sequences or attach/unattach the pre-loades pfSequences nodes dynamically
when I need them.

Please, I need suggestions to resolve this

Thank you very much,

Jose M. Lopez

-----Mensaje original-----
De: Max Waterman <maxw++at++sgi.com>
Para: José María López <jmlopez++at++espelsa.es>
CC: info-performer++at++sgi.com <info-performer++at++sgi.com>
Fecha: martes, 29 de septiembre de 1998 21:20
Asunto: Re: How to delete a graph?

ate
a DBASE call-back and register it in main() before your simulation loop :-

> pfDBaseFunc( DbaseCallBack );

and in this call-back make a pfBuffer :-

> static pfBuffer *buffer = NULL;
>
> if ( buffer == NULL )
> {
> buffer = pfNewBuffer();
> pfSelectBuffer(buffer);
> }
>

then, also in the DBASE call-back, when you want to delete a node :-

> pfBufferRemoveChild( scene, node ); /* effected in pfMergeBuffer
*/
> pfAsyncDelete( node ); /* effected in pfDBase */

and you should also load any new node in this call-back, for example :-

> node = pfdLoadFile(files[i]);
> pfBufferAddChild( scene, node );

When your done adding or deleting :-

>
> pfMergeBuffer();
> pfDBase();

Because you're paging stuff, you will encounter fragmentation in various
places, including the shared arena. To relieve these symptoms, you should
call :-

> /* search through 1000000 entries in the free block list before
giving up and allocating more */
> amallopt( M_MXCHK, 1000000, pfGetSharedArena() );
> /* place free stuff at beginning of free list, so it's found more
quickly */
> amallopt( M_FREEHD, 1, pfGetSharedArena() );

before your simulation loop in main().

You might want to fork off the Dbase procedure into it's own process. To do
this, call :-

> pfMultiprocess( PFMP_FORK_DBASE );

before pfConfig() in main().

I hope this helps.

Max.

PS. Note that this does not delete the GL texture names, which could cause
problems. To do that you will need to :-

1) make a DRAW call back function [2] and register it with pfChanTravFunc()
[1]
2) at node deletion time, have the DBASE function
  a) construct a list of pfTextures with pfuMakeTexList() (or
pfuMakeSceneTexList()),
  b) store that in memory shared between DBASE and DRAW,
  c) set a flag (also in that shared memory) to tell the DRAW to delete and
wait for it to be reset
3) make the DRAW call back test the above flag on each iteration, and, when
it's set,
  a) call pfDeleteGLHandle() on each pfTexture in the list
  b) reset the flag to let the DBASE continue.

[1] don't forget to call pfClearChan() and pfDraw() in the DRAW callback.
[2] it doesn't matter if you multiprocess the DRAW or not, you _should_
still do a DRAW call-back when doing OpenGL calls (which pfDeleteGLHandle()
does).

> José María López wrote:
>
> Hi everybody,
> Does anyone know how to delete some nodes completely, including
vertex,
> textures, and color coordinates? We need to do it in real time. What we
wnat
> it's to load and unload dynamically entire subgraph for save memory.
> We have performer 2.2.2 and IRIX 6.5 in a Octane
>
> Thank you very much,
> Jose M. Lopez
>
> **********************************************************
> Jose M. Lopez
> Project Manager
> ESPELSA STC
> Acanto 22
> 28045 Madrid, Spain
> Phone: +34 1 527 02 15
> Fax: +34 1 530 10 25
> email: jmlopez++at++espelsa.es
> ***********************************************************

--
Max Waterman. mailto:maxw++at++sgi.com  "Get off me cheese! Get off! Get off!
PSE-GPS                             Grommit, Grommit! Go for him! Off!"

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Sep 29 1998 - 10:47:30 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.