Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Weird rendering bug


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 BraXi   Members   -  Reputation: 187

Like
0Likes
Like

Posted 24 November 2012 - 08:21 AM

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.

Sponsor:

#2 BraXi   Members   -  Reputation: 187

Like
0Likes
Like

Posted 24 November 2012 - 03:48 PM

Nevermind, I found it was caused by other function in my engine.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS