Sign in to follow this  

Sending as much data as I can?

This topic is 4834 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 want to minimize the amount of calls I make for this one area. All be it a small one, I want to make sure that calling this small area is clean. I'll have about 400 faces + texture coords. Now, I found this thread on GD awhile ago and something _the_phantom said stuck out in my head (The thread) he said sending as much in a stream as I can. Now, I have setup my vertex array (2d) with [x1][y1][u1][v1] ect ... I dont need to store normals nor do I need color information. how can I send this data in one call? or can I? I know I could break these out and use gl*Pointer but I was hoping that I can send this as one stream. any suggestions on reading?

Share this post


Link to post
Share on other sites
gl*Pointer will work fine, thanks to the "stride" element. It allows you to specify that there's some space between (for instance) the beginning of each set of texture coordinates.

It gets even easier, though. See documentation for the glInterleavedArrays() function for how.

Share this post


Link to post
Share on other sites
If that data is static (or not...but it's more of a hassle if it's not) I suggest you try out Vertex Buffer Objects (ARB_vertex_object_buffer). There's been a few threads about them recently you can look at. This is still a relatively new extention, so if compatibility with older cards is a big issue, you can use the regular glInterleavedArrays as suggested by previous poster.

I just learned how to do VBOs and I'm happy with the performance I'm getting for static data.

Share this post


Link to post
Share on other sites
Quote:
Original post by renderer
If that data is static (or not...but it's more of a hassle if it's not) I suggest you try out Vertex Buffer Objects (ARB_vertex_object_buffer). There's been a few threads about them recently you can look at. This is still a relatively new extention, so if compatibility with older cards is a big issue, you can use the regular glInterleavedArrays as suggested by previous poster.

I just learned how to do VBOs and I'm happy with the performance I'm getting for static data.


from what I gather they are only important if you have a certain number of vertecies and higher? I'm guessing 400 faces is not within that range.

and no they are not static.

Share this post


Link to post
Share on other sites
More like...you may only see a big performance boost with a certain number of vertices.

VBOs put your vertex(normal/color/tex ect) data in a piece of AGP memory (a reserved section of your main memory), so you have really fast transfers to your video card. This will give you a performance gain for even a small size of vertices/triangles.

You can specify it as dynamic and read/write to it for updates. But, if interleaved arrays works for you too, then there's nothing wrong with that.

Share this post


Link to post
Share on other sites

This topic is 4834 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this