Archived

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

Locking vertex arrays screws over my framerate?

This topic is 5746 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'm working on a terrain engine. I'm using heightfield data that I load from a bitmap file. I'm drawing my terrain using triangle strips. I have two primary methods of rendering the terrain right now. The first is to call a display list that draws all the terrain (one triangle strip per terrain row.) The second is to draw only a limited part of the terrain around the camera (always a square section of the terrain, has nothing to do with the camera rotation, only position.) The second is much faster, as you might expect. However, something strange is occuring - when I try to use the locked vertex arrays extension, my framerate using the second method drops substantially. In fact, while locked vertex arrays are used, the framerates between the two methods are virtually identical. Without the locked vertex arrays, I generally get around 30-40 FPS with the first method and around 100 FPS with the second. There isn't any significantly noticable difference in the FPS of the first method with or without locked vertex arrays. I'm only locking/unlocking the vertex arrays once - they're locked immediately after initialization, and unlocked at program shutdown. What's up with this? I'm using vertex arrays for vertex data, color data, and texture coordinate data (no lighting at the moment). Edited by - Zorodius on March 23, 2002 12:31:23 AM

Share this post


Link to post
Share on other sites
quote:
Original post by IndirectX
I''m guessing here, but... shouldn''t you unlock them as soon as you fill them with data, before you render what''s in them?


No, since locking means that you''re not going to change the contents, thus the system can stick them in the gfx card memory once and for all, instead of loading them every frame.

Share this post


Link to post
Share on other sites