Skip to main content
GameDev.net gamedev.net
🔒 Locked

Meshes vs. Custom Models

Started by ttigue Sep 2, 2003 at 1:40 PM 2 replies 450+ views
Original Post
ttigue
ttigue
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
Hawkeye3
Hawkeye3
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 )
psykr
psykr
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.
ttigue
ttigue
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.