Meshes vs. Custom Models

Started by
2 comments, last by ttigue 20 years, 7 months ago
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
Advertisement
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 )
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.
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)<br>}<br><br>is that right? is it faster just to use a mesh? </i>

This topic is closed to new replies.

Advertisement