Nicolas Gauvin (nicolas++at++cae.ca)
Fri, 18 Apr 1997 14:35:59 -0400
Here is a suggestion:
Use a pre cull callback explicitely do a shallow frustum culling
test using pfChannel::contains(const pfSphere* sph) on the bounding
sphere of the current node. You need to first translate the bounding sphere
center with the current transformation matrix. If this test is_maybe then do
your own plane occlusion test.
Something like:
preCullCB( pfTraverser* _trav, void* )
{
pfNode* node = _trav->getNode();
pfSphere bsphere;
_node->getBound(&bsphere);
pfMatrix mat;
_trav->getMat(mat);
// translate bsphere center
bsphere.center[PF_X] += mat[3][PF_X];
bsphere.center[PF_Y] += mat[3][PF_Y];
bsphere.center[PF_Z] += mat[3][PF_Z];
pfChannel* chan = _trav->getChan();
// test it with channel frustumn
if (chan->contains(&bsphere) & (PFIS_MAYBE)) {
if (yourOcclusionTest(...) == TRUE) {
pfCullResult(PFIS_TRUE); // to bypass Performer's default culling
return PFTRAV_PRUNE;
}
}
return PFTRAV_CONT;
}
I haven't tried this myself, but I believe something like this should work.
--
Nicolas Gauvin CAE Electronics Ltd., 8585 Cote De Liesse
Software Developer Saint-Laurent, Quebec, Canada, H4L-4X4
3-D Graphics Applications tel: +1 514 341 2000 extension 2275
nicolas++at++cae.ca fax: +1 514 340 5496
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:05 PDT