Archived

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

luxitan

mesh vs index & vertex buffer

Recommended Posts

Should i use a dx mesh or use my own index & vertex buffers? Currently i''m using meshes but i''m having trouble to render more than one texture, i can''t figure out how am i suppose to create dynamic subsets. Wich one is faster when rendering? I''m also using mesh because of D3DXIntersect method, its alot easier with meshes!! I also thought in having both at the same time using one or other depending on the task, but that would make me coding almost everything twice, do you think it''s worth it? So, should i change to vb & ib or not ? thanks
To be considered a genius you just have to say what everybody knows in a way very few understand

Share this post


Link to post
Share on other sites
You can set your own subsets easily. Just call LockAttributeBuffer() and set the AttribId (DWORD) per face and then unlock it. Check out the http://www.mvps.org/directx/articles/d3dxmesh.htm by Robert Dunlop.

- Mete

Share this post


Link to post
Share on other sites
Well, if you have a look under the hood of dx meshes, they''re also using vertex and index buffers, only that all access is neatly done by microsoft. But remember: there''s nothing such as free lunch! Meshes are very convenient to use, but the main disadvantage is that each mesh uses it''s own buffers -> you constantly switch source buffers, which takes some time.
You should get better results with less buffers - and you actually learn how things really work, which is even better than those fps you''ll gain

Nescis mi fili, quantilla prudentis mundus regatur

Share this post


Link to post
Share on other sites
ypu can convert your scene hierarch to a single mesh so u gut a single vertec buffer. and you can access this vertex buffer as you can (also u can make your own index buffer which points to the meshes vertex buffer

Share this post


Link to post
Share on other sites
thank you for the answers

right now every object i have got his own mesh, so i''m not doing the one for all buffer (a little to complicated for me to handle right now) i''ll stick to the meshes using the atribute buffer

when i start the war against fps then i will think about one n only vertex buffer

thanks again



To be considered a genius you just have to say what everybody knows in a way very few understand

Share this post


Link to post
Share on other sites
quote:
Original post by Moh_Abed
ypu can convert your scene hierarch to a single mesh so u gut a single vertec buffer. and you can access this vertex buffer as you can (also u can make your own index buffer which points to the meshes vertex buffer


Hey, that''s neat.. maybe I should really have a look at meshes after all. Thanks for the hint.

Nescis mi fili, quantilla prudentis mundus regatur

Share this post


Link to post
Share on other sites