Qbound
10-26-2003, 06:10 AM
Hi,
i work on a terrainengine, wich is divided in pages and the pages are diveded in small patches. The size of the patches are 64*64 Vertices. Each row is a Trianglestrip.
I have 1 Vertexbuffer and 1 Indexbuffer foreach Patch. The buffers are VBOs now i got the Problem that i want to render each row from a patch as an unique Trianglestrip because if i render the whole patch with one call to glDrawElements() i got ugly crossing triangles from one side of the patch to the other side. Wich is logical...
So ive to render each row of the patch individually, so there is my problem.
Can i use glDrawRangeElements on VBOs?
Here is my Renderloop:
m_pRender->glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, m_pIndices[ m_uiLOD ].uiID );
// Durch alle Strips loopen
for( uiCounter = 0; uiCounter < m_pIndices[ m_uiLOD ].uiSizeX - 1 ; uiCounter++ )
{
// Positionen holen
uiStart = uiCounter * m_pIndices[ m_uiLOD ].uiSizeY * 2 - 2;
uiEnd = uiStart + uiNum;
// Arrays rendern
m_pRender->glDrawRangeElements( GL_TRIANGLE_STRIP, uiStart, uiEnd, uiNum, GL_UNSIGNED_INT, NULL );
}
i work on a terrainengine, wich is divided in pages and the pages are diveded in small patches. The size of the patches are 64*64 Vertices. Each row is a Trianglestrip.
I have 1 Vertexbuffer and 1 Indexbuffer foreach Patch. The buffers are VBOs now i got the Problem that i want to render each row from a patch as an unique Trianglestrip because if i render the whole patch with one call to glDrawElements() i got ugly crossing triangles from one side of the patch to the other side. Wich is logical...
So ive to render each row of the patch individually, so there is my problem.
Can i use glDrawRangeElements on VBOs?
Here is my Renderloop:
m_pRender->glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, m_pIndices[ m_uiLOD ].uiID );
// Durch alle Strips loopen
for( uiCounter = 0; uiCounter < m_pIndices[ m_uiLOD ].uiSizeX - 1 ; uiCounter++ )
{
// Positionen holen
uiStart = uiCounter * m_pIndices[ m_uiLOD ].uiSizeY * 2 - 2;
uiEnd = uiStart + uiNum;
// Arrays rendern
m_pRender->glDrawRangeElements( GL_TRIANGLE_STRIP, uiStart, uiEnd, uiNum, GL_UNSIGNED_INT, NULL );
}