Sign in to follow this  

Index/Vertex Buffers for meshes

This topic is 3489 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'm trying to render a mesh using direct3d's index and vertex buffers, I usally process each polygon in the scene(clipping, transform, project) and then simply render it, but I've heard that filling the vertex index buffer on each pass and then sending to the GPU would not get as good a performance as filling the whole buffers with the screen space data and then sending this off to the GPU, the problem is that I have know way of knowing how many vertices(once clipped) there will be in a scene and also I would have to store a buffer for each mesh. simply - how would you normally render meshes/scenes using the vertex and index buffers(without TnL)?

Share this post


Link to post
Share on other sites
Quote:
Original post by staticVoid2
...I've heard that filling the vertex index buffer on each pass and then sending to the GPU would not get as good a performance as filling the whole buffers with the screen space data...


I'm not sure what you mean by 'filling with screen space data'. The usual approach is to store you object space vertices for a given mesh in a vertex/index buffer. You can then render the same object in different places by applying different object to world transformations.

You do not (in most circumstances) need to refill the buffers each frame.

Share this post


Link to post
Share on other sites
It's not - you have already filled the vertex and index buffers before you start rendering frames. Then, for each frame, you simply call a function (I think it is DrawPrimative() in Direct3D?) and specify which vertex/index buffer to draw from. Of course your transformations can, and usually do, change per frame.

Also, you can change the contents of the buffers later. I'm just giving the basic case.

Share this post


Link to post
Share on other sites
Quote:
Original post by PolyVox
It's not - you have already filled the vertex and index buffers before you start rendering frames. Then, for each frame, you simply call a function (I think it is DrawPrimative() in Direct3D?) and specify which vertex/index buffer to draw from. Of course your transformations can, and usually do, change per frame.

Also, you can change the contents of the buffers later. I'm just giving the basic case.


I'm rendering 2D triangles not 3D, I think you are meaning that I put all the objects 3d vertices in the buffer and render each frame using direct3d's own transform functions, I'm trying to render screen space primitives which means I will probaly have to fill the vertex/index buffers each frame, I was wondering if this is the way it is normally done(to fill the buffers with all triangles) or do you simply fill the buffers with one triangle, send it to the GPU and then move on to the next triangle in your scene and repeat?

Share this post


Link to post
Share on other sites
Ah, sorry, I misunderstood you. I didn't realise you were rendering screen space primitives in 2D. Now I'm not so sure I'm afraid...

Share this post


Link to post
Share on other sites

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