Archived

This topic is now archived and is closed to further replies.

Rendering Speed...(HELP!!)

This topic is 6165 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

I wrote a basic terrain engine that initially just used immediate mode functions over and over in a loop to render the terrain: it called glVertex3f(...) etc. to draw a number of triangle fans. I can get about 6.5 MTris/sec. I rewrote the engine to use indexed vertex arrays (uses glDrawElements to render) and it could only manage like 2.5 MTris/sec!?! I did another rewrite to have it use compiled vertex arrays and that got me up to maybe 3-3.5, but that is still terrible. Why is this slower?? I thought immediate mode functions were the slowest by far... The arrays are pretty big: 800k or so for the vertex and texture coord arrays each, and a couple megs for the index array (this is at maximum terrain size of about 130,000 triangles) Could the slowdown be a result of a constant need for data copying? I thought using compiled vertex arrays was supposed to take care of that. Anyone have any thoughts on what could be causing the problem? And what are my options? I thought indexed arrays was about the only way to go because otherwise I would start hogging tons of memory. Any help would be appreciated!!

Share this post


Link to post
Share on other sites
I''m having the same problem as you. People with faster computers and vid cards than mine are getting really slow framerates. I don''t get it.

How do you impliment Compiled Vertex Arrays? Is that where you use glLockArraysEXT(0, nVertices); and glUnlockArraysEXT();? I don''t know when to use these functions or how it benifits. Could you show me some code using it? I did a search on the subject but I couldn''t find implimentaion samples.

Share this post


Link to post
Share on other sites
Well lower tris/sec means lower framerate. Roughly 20 a second with indexed vertex arrays versus 50 with just immediate mode functions. And yes you use the lock and unlock extension functions to implement compiled vertex arrays. The idea is to "lock" the array data when you know that you won''t be changing the data, or at least not changing it very often. Certain OGL implementations can take advantage of that and optimize performance. Just lock the array after you have it set up with your data. If you need to see code, email me. Anyone else reading this: I could still use some insight into what is going on here....thx

Share this post


Link to post
Share on other sites