CVA isn't any faster...

Started by
2 comments, last by gimp 22 years, 8 months ago
I''ve just implemented Compile vertex arrays but it doesn''t seem any faster than normals arrays, at all. Specifics: Drawing individual models of 200-600 polygons each, with one at 14000. Not textured, just lit and coloured. Total scene polygons : ~25000 at 32fps. System: Athlon 700, 384mb(133mhz) ram, Geforce2. Here is how I use CVA''s:
  

m_LockArrays(0, a_Mesh.Indices.size()-1);
glDrawElements(GL_TRIANGLES, a_Mesh.Indices.size(), GL_UNSIGNED_SHORT, a_Mesh.Indices.begin());
m_UnlockArrays();

  
At first I thought I might be fill limited as there is a fair amount of overdraw, however when I reduce the size from 800*600 to 100*100 the speed change is minimal (35fps in test above). I profiled the application, by far largest function time is the rendering function. Any idea''s? Many thanks Chris Brodie http:\\fourth.flipcode.com
Chris Brodie
Advertisement
Are you drawing the same model many times or just many different models? If you are doing the latter, you won''t get a speed up. The point of compiled vertex arrays is to allow the driver to cache the transformed vertices so you can draw the same geometry many times without having to re-transform the vertices each time you draw it.

Nate
also 14000 is prolly to many in one hit break that in two.
also m_LockArrays(0, a_Mesh.Indices.size()-1); is wrong its not the number of indices but the number of vertices.
but most of all for the example u gave i dont expect a speed up

try this

m_LockArrays(0, numverts);
glDrawElements(GL_TRIANGLES, a_Mesh.Indices.size(), GL_UNSIGNED_SHORT, a_Mesh.Indices.begin());
change texture

glDrawElements(GL_TRIANGLES, a_Mesh.Indices.size(), GL_UNSIGNED_SHORT, a_Mesh.Indices.begin());
m_UnlockArrays();
Thanks, I think I have a better understanding of this now... Though doing state changes betwen mesh rendering will require a number of engine changes...

Back to the drawing board...

Chris Brodie
http:\\fourth.flipcode.com
Chris Brodie

This topic is closed to new replies.

Advertisement