Archived

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

Vertex Arrays ?, are they any good ??

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

Hi, I''ve been taking a look at Vertex Arrays for the first time. Although I can see that using them can give greater speed inceases and keeps your code cleaner, there are a few points that I dont understand.. can anyone please help me out ? 1. If you want to use different textures on different parts of your mesh you''d have to define separate arrays ? (As there''s no array for specifying what texturemap it should read from) 2. Also texturing.. If for example, I defined a cube using vertex arrays with texture coordinates, you would need 24 separate vertexes (4 per side) so that you can setup the texture coordinates correctly and have the texture reading correctly on all sides. 3. Without using the LOCKING commands, is there much improvement using the arrays over a bog standard structure array ?. Thanks !.

Share this post


Link to post
Share on other sites
1) No, you''d have to use many glDrawElements calls; but the vertices (and indices) can be in the same array.

2) That''s true, but it''s still better than the 36 glVertex3f calls you''d need with glBegin/glEnd.

3) If by "locking" you are refering to the compiled vertex array extension, then you''d see an improvement for non-T&L video cards ( it works pretty well on the TNT for example ). If you are refering to D3D''s lock/unlock commands, there is no equivalent in OpenGL. Generally, you shouldn''t expect a big speed increase when going from glBegin/glEnd to vertex arrays, unless you become CPU limited ( ie. drawing frames with 100 of 1000''s of triangles ! ).

Y.

Share this post


Link to post
Share on other sites