Something wrong in Quake 3 map rendering
These Days I am working at Quake3 Map Rendering.
When I enable visBitData Check ,some faces disappear improperly.
That is: A face is just in front of the camera ,but disappears.The count of the strange faces is about 2% of total.
There is no other visibility check ,such as BoundingBoxCheck.Just only the visData in .bsp file.
typedef struct
{
int nVecCount ; // Number of vectors.
int vecSize ; // Size of each vector, in bytes.
unsigned char* vecs ; // Visibility data.
// One bit per cluster per vector.
}VisData;
VisData *m_pVisData;
bool CQuakeMap::CheckVisDependOnBitInfo( int from ,int to)
{
unsigned char* pTemp = m_pVisData->vecs ;
int order = from * m_pVisData->vecSize ;
pTemp += order ;
int colum = to / 8 ;
pTemp += colum ;
int bitPos = to % 8 ;
unsigned char cmp = 1 << bitPos ;
if( *pTemp & cmp )
return true ;
return false ;
}
Could any experienced friend give me a clew?
Thanks!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement