Something wrong in Quake 3 map rendering

Started by
0 comments, last by gxsh 17 years, 5 months ago
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!
Advertisement
I found the answer.
The faceIndex in the Face Struct is not the index in the face lump,but the ones in the leaf_face lump.I took the wrong indices.

This topic is closed to new replies.

Advertisement