Weird rendering bug

Started by
0 comments, last by BraXi 11 years, 5 months ago
Hello, I've recently ran into trouble regarding rendering of Q3 BSP. So I've readen all important data from bsp and checked all pointers to data from mesh and I'm trying to render level with vertex arrays.

Somehow, instead of level I'm seeing weird planes (picture below):
http://s6.ifotos.pl/img/bug3JPG_xnaxrhn.JPG

And this is what I'm trying to render:
http://s4.ifotos.pl/img/radiantsh_xnaxsns.JPG


At the rendering stage I'm rendering only brushes (polygon groups built from triangles) with this function:
void BSPMesh::RenderPolygonFace( int faceIndex )
{
tBSPFace *pFace = &m_pFaces[faceIndex];
glVertexPointer( 3, GL_FLOAT, sizeof(tBSPVertex), &m_pVerts[pFace->startVertIndex].vPosition );
glTexCoordPointer( 2, GL_FLOAT, sizeof(tBSPVertex), &m_pVerts[pFace->startVertIndex].vTextureCoord );
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
if(0)
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, m_textures[pFace->textureID] );
}
glDrawElements( GL_TRIANGLES, pFace->numOfIndices, GL_UNSIGNED_INT, &m_pIndices[pFace->startIndex] );
glDisableClientState( GL_VERTEX_ARRAY );
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
}


I'm using OpenGL 2.0 on a Nvidia GF 7600GS - yeah it's pretty old card.
Advertisement
Nevermind, I found it was caused by other function in my engine.

This topic is closed to new replies.

Advertisement