Sign in to follow this  
gxsh

Something wrong in Quake 3 map rendering

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this