• Advertisement
Sign in to follow this  

VBOs and triangle strips

This topic is 4789 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 don't know if i'm writing in the right place but since I'm a begginer to VBOs I believe it's appropriate :) So the point is that in NeHe tutorial about VBOs GL_TRIANGLES are used and I would like to use TRIANGLE_STRIPS. What do you think the format I keep my terrain data should be? What should I put in the buffer. How to draw these strips or can I do it as one strip?! I'm all new to these extension things and I found myself here because I just wrote my first application that has low fps :D Please help! Maybe you know some pages or articles about VBOs so I could learn more.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by copacabana
I don't know if i'm writing in the right place but since I'm a begginer to VBOs I believe it's appropriate :)


Could always ask in the OpenGL forum, would probably get more responses

Quote:

So the point is that in NeHe tutorial about VBOs GL_TRIANGLES are used and I would like to use TRIANGLE_STRIPS. What do you think the format I keep my terrain data should be?


If you plan to use VA's or VBO's the performance of indexed triangles and triangle strips would be near identical. I would suggest using indexed triangles over strips myself.

Quote:
What should I put in the buffer.


You can have a vertex buffer GL_ARRAY_BUFFER and an index buffer GL_ELEMENT_ARRAY_BUFFER. These two would be sitting in different VBO chunks. The vertex buffer would be loaded with your per vertex data like the vertex position, normal, color (if you use it) and texture coordinates. The index buffer will just be loaded with indicies to index into the vertex buffer (3 indicies will form a triangle with the 3 vertecies indexed).

Quote:

How to draw these strips or can I do it as one strip?!


You could draw it as one whole strip but i wouldn't recommend doing that, instead you should break the terrain into patches. This way you can cull out each patch (and groups of patches at a time) and not send this data to the graphics card which will considerably improve speed.

You draw them the same way you would draw normal vertex arrays, except instead of setting the pointers to the arrays now you would set them to the offset into your VBO buffers. You will also need to bind the array and element buffer before you can do a glDrawElements or glDrawArrays call.

Quote:

Maybe you know some pages or articles about VBOs so I could learn more.


ARB_vertex_buffer_object specifications, very handy to have.

codesampler has lots of openGL tutorials, covering VBOs too.

HTH

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement