Archived

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

ttigue

Meshes vs. Custom Models

Recommended Posts

ttigue    122
Hello - I''m pretty new to Direct3d. I was wondering if it is faster to use the .x file meshes & formats that microsoft provides or to use custom user models. If i use custom user models is their a materials buffer i can use. I know that direct3d Api provides a vertex buffer and index buffer which, if possible, will be created in video memory. but do i have to implement code to change the material for every face that is drawn? Thank you Tyler

Share this post


Link to post
Share on other sites
Hawkeye3    122
If you plan on using your own model format, you will have to handle all of the buffer management on your own ( how they are filled, released, and used )

Share this post


Link to post
Share on other sites
psykr    295
The ID3DXBuffer interface that the samples use to load .x files isn''t really needed.. in Zen of Direct3D, the author never uses the interface, and instead just uses new D3DMATERIAL8[] as the buffer.

Share this post


Link to post
Share on other sites
ttigue    122
So - if i set up a vertex buffer and an index buffer

i could do the following-
(i know this isn''t the exact coding - but i don''t have the api in front of me)

draw_indexed_primitive(vb, ib, .....)

but if i want to add materials i have to create my own materials buffer and then do the following-

for (i = 0; i < num_indices; i++)
{ set_material->material;
draw_primitive(vb, ib[i])
}

is that right? is it faster just to use a mesh?

Share this post


Link to post
Share on other sites