display lists in cull traversal

New Message Reply Date view Thread view Subject view Author view

Christopher Geyer (cgeyer++at++seas.upenn.edu)
Wed, 2 Jul 1997 09:42:24 -0400 (EDT)


Regarding the problem that I posted about before. I'm trying to render a
shadow volume in a separate display list from the scene. It seems that
I've figured out the problem, but I'm not exactly sure how to fix it.

As I told you in the cull traversal I'm creating a separate display list
for my shadow volumes. So I've created a descendent of pfGeode which
contains only shadow volume geometry. It has it's own post & pre cull
callback.

abbreviated:

static pfDispList *currentDL; // actually a member of my class
static pfDispList *shadVolDL; // init'd elsewhere

preShadVolCullCallback( ... )
{
  currentDL = pfGetCurDList( );
  currentDL->close( );
  shadVolDL->open( );
  return( PFTRAV_CONT );
}

// in between capture the draw commands for the shadow volume
// in the shadVolDL

postShadVolCullCallback( ... )
{
  shadVolDL->close( );
  currentDL->open( );
  return( PFTRAV_CONT );
}

drawChannelFunc( ... )
{
  pfDraw( ); // one extra pop
  shadVolDL->draw( ); // one extra push
}
  
So I temporarily bypass the current display list. Would this not be correct?

What happens is that for some reason a popmatrix() (or apparently the
token DL_POPMAT) does not get appended to the shadVolDL. It instead gets
appended to currentDL. So I have an extra pushmatrix() without its
corresponding popmatrix() in a my shadow volume display list; and I have
an extra popmatrix() without a cooresponding pushmatrix() in the scene
display list (this is what I gather from looking at output from gldebug).

It would seem that AFTER the call to preShadVolCullCallback() a
pushmatrix() is being added, and that AFTER postShadVolCullCallback() a
popmatrix() is being added. Wouldn't it either be before and after, or
after and before, but not after and after?

Why would that happen? Obviously I'm not doing things in the right order.
What would the correct order be?

Christopher

----------------------------------------------------------------------------
 Christopher Geyer | CompSci and Math '99 at the University of Pennsylvania
  215-732-4218 | cgeyer++at++seas.upenn.edu | http://www.seas.upenn.edu/~cgeyer/
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:33 PDT

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