Jump to content
  • Advertisement
Sign in to follow this  
enigmatix

Trying To Understanding Direct3D...

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

Hello everyone, I recently got into programming Managed Direct3D in hopes to create a 3d game engine. I chose C# for the language because, frankly, it's not as tedious as C++. In fact, I think I have a pretty good understanding of it already. Anyways, I've been going through several tutorials, mostly the ones that come with the SDK. Now, they're good tutorials, but what i really wanted them to give me was a better understanding of direct3D. I know how to draw verticies and triangles and such. I know you can use meshes, but when should I do either of the two? I've seen tutorials where index and vertex buffers were used to draw a height mapped mesh, but why do so if direct3D includes .x mesh capabilities? What do you think is the best route to take, should I be using direct3D methods in all cases, or do i pick and choose? Should I be relying totally on the features provided in Direct3D? I know it's a lot to answer, but any input will do. I just want to get a better idea of what i'm getting into here.

Share this post


Link to post
Share on other sites
Advertisement
The Mesh class is actually only a little more than an encapsulation of a vertex buffer and an index buffer (and an attribute buffer for per-face material indices), and was originally meant as a convenience to aid in geometry prototyping. The later D3DX functions except mesh interfaces instead of raw data in most cases, but this is just a matter of logistics.

If you want to quickly load .x files for prototyping your game, the Mesh is the definite way to go.

If you want to use the various functions of D3DX like those involving pre-calculated light transfer, you might want to use Mesh anyway even if the last condition wasn't true.

If you have dynamic geometry that you will change every frame, you'll want to use raw vertex and index buffers.

Finally, if you have more optimal rendering strategy than D3D and D3DX can provide (which is very rare for a beginner), you definitely want to use raw vertex and index buffers and implement your buffer/renderstate changes manually.

You can use both approaches interchangeably in the same application, so you needn't choose up front what you ultimately want to do.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!