Original Post
Hi all, First of all - great forum. I've been a quiet reader for some time now and I'm very impressed with the technical level of some of you people. On to my question(s). I'm currently working towards creating a DirectX9 based renderer. I got stomped by several concepts, and I'd appreciate any help/reference/etc. Note that I have read everything I could find in the SDK but still I am a bit puzzled. I guess I'm lacking some background here. First of all, I'd like to know if I got something right. Suppose I've set up a simple vertex buffer and an index buffer, which together create a box. Now I want a simple application that will just rotate the box each frame in all three axes. If I am correct, then if I've used a non-transformed VF, like D3DFMT_XYZ, then I do not need to change the vertices myself - I just set all these matrices correctly, and my vertices will be transformed correctly. If however I use D3DFMT_XYZRHW, then I need to take care of transforming the vertices myself. Is that correct? Supposing I am right, I'll continue to other questions. Why would I want to use a dynamic vertex buffer, if the mesh does not change? I mean, take the box I've mentioned - I guess I don't really need the vertex buffer to be dynamic, because I will not change it, right? As far as I can understand, the only reason to use a dynamic vertex buffer is if my mesh changes - but why would that happen? I'd love to hear a real-life example for something like that (docs I've seen are talking about "a change that occurs many times per frame" - ???). I think that my major problem is that I have several open source references and several books, and each one of these is acting differently. This is very confusing for a beginner. Yet another question is - do I need to create a VB/IB every time I render it? This is the way it's done in Eberly's wild magic, and it looks like a really huge waste of ticks - isn't it? Last question - I saw that you can use a static vertex buffer to host many of your meshes together, while changing the index buffer for rendering the "correct" mesh. Now, making this magic happen would require some kind of "stacking" meshes by a manager, that will collect all the meshes and keep offsets etc. Is this really worth the effort, or should I aim at a buffer-per-mesh? What are the real advantages in a single static vertex buffer? This is quite a lot of questions and I hope I didn't bore you all up. Any help would be greatly appreciated. Thanks a lot, Eldad.