Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Weird rendering bug

This topic is 2131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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):

And this is what I'm trying to render:

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 );
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!