some questions about direct3d9

Started by
3 comments, last by Buckeye 15 years, 8 months ago
hi, im moving from opengl to directx, and i have some questions... i have been doing many examples for d3d, and i found vertex buffers and index buffers are good for saving space and boos the performace. In opengl there is something called "vertex arrays" which is pretty much the same thing. But that technique is old. Also, it has something called Vertex Buffers Object (vbo) which is actually a "better" version of vertex arrays. "Recently" they release the FB0 (or something like that, which apparently is even better). Now, my question is, which are the "new" techniques and utilities in D3D9 (with enough documentation and examples on the internet) that i should use? and what does that replaces? for example, 1.-what is better than vertex buffers and index buffers? 2.- whats the best option for matrix operations? 3.- and for effects? (lighting, shadows, etc..) 4.- and for working with meshes? (.x for example) 5.- and for spatial partition? by those questions, i dont mean that for example someone answer: "for spatial partition you should use octrees", but instead of that, something like: "well, before you had D3DOctree::Create(D3DMesh *meshdata), but now you have D3DXNEWOCTREE:Create(D3DXMesh *meshData) which is faster and easier to use and comes in "x library" thanks for your advices. cheers!
Advertisement
Quote:Original post by BlackWind
Now, my question is, which are the "new" techniques and utilities in D3D9 (with enough documentation and examples on the internet) that i should use? and what does that replaces?
One nice aspect of D3D versus OGL is that, more or less, what you see is what you get - you don't have to mess around with extensions that do the same job only better; this is even more the case now with D3D10 and onwards. The tools you're provided with are the ones you actually use.

Quote:1.-what is better than vertex buffers and index buffers?
Vertex and index buffers in D3D are the equivalent of Vertex Buffer Objects (VBO's) in OGL.
Frame Buffer Objects (FBO's) are something completely different but designed with the same object model, hence the similarity in name.

Quote:2.- whats the best option for matrix operations?
As a rule of thumb: Do them in shaders wherever it makes sense, otherwise do them on the CPU using a maths library like the one found in the D3DX (D3DXMatrix and associates).

Quote:3.- and for effects? (lighting, shadows, etc..)
Prefer to use the programmable pipeline. So either use the existing D3DX Effects Framework or write your own to manage shaders manually.

Quote:4.- and for working with meshes? (.x for example)
Again, either use the existing classes in the D3DX (like ID3DXMesh) or write your own.

Quote:5.- and for spatial partition?
More specialist higher level structures such as these don't exist as part of the D3D(X) API, you'd do it all yourself or find some other library to do it for you.

Check this sites, these has got good amount of directX tutorials.

http://directxtutorial.com/

http://www.chadvernon.com/blog/tutorials/

http://www.drunkenhyena.com/cgi-bin/directx.pl

All the sites are very helpful with loads of examples.

Hope this helps...
thanks a lot for your help.
cheers!
Don't forget that OGL uses a right-hand coordinate system and CCW triangles (default culling of CW) and DirectX uses a left-hand system and (commonly) culls CCW. You can't simply import OGL vertex data. There's a bit of manipulation required if you do that.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement