Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a project that I'm doing in Managed DirectX (DX9) where I want to render lots of grass. My current method (many draw calls) is slow, but I've heard Geometry Instancing can fix that.

I know that I have to have one vertex buffer to store the vertices that will drawn multiple times. I know that I need another vertex buffer to store the transformations (from what I've seen you can only have one additional vertex buffer). So should the second vertex buffer store transformation matrices? I tried coding this, but when I want to create a new vertex buffer one of the required parameters is vertexFormat, but I can't supply a vertex format since this is a matrix.

I also wanted to try to have the second vertex buffer store the translation values as Vector3, but how do I tell DirectX that the values in the second vertex buffer are to be used as translation values? Secondly, I also need rotation values. Do I store these in a third vertex buffer?

Basically, I want to use geometry instancing to draw multiple instances of a quad that are rotated and translated.

share|improve this question
 
What, specifically, are you having trouble with? This is pretty close to a "where to get started" type question. You need to try to implement this and tell us where it's going wrong. –  Byte56 Jan 8 at 1:29
 
@Byte56 After reading What topics can I ask about here? and What types of questions should I avoid asking? it seems to be fine on this webiste. The latter article also states that questions like “I would like others to explain ______ to me” are OK. I'm sorry if I misinterpreted something. If I indeed am wrong, do you know where I could ask a question like this? –  davidwroxy Jan 8 at 2:02
 
Yep, there's also a scope limitation. It's totally fine to have people explain things to you, but the scope needs to be limited. Large topics should be broken up into smaller parts. Then those smaller parts can be explained separately. This is why I ask for a more specific problem you're having. Generally the best way to find out that specific problem is to try implementing it and see where you get stuck. –  Byte56 Jan 8 at 2:12
 
@Byte56 I edited my question, explained where I got stuck and for what I exactly need geometry instancing. Does that help? –  davidwroxy Jan 8 at 2:27
 
Much better, thanks. I did a little editing to cut down on the intro. –  Byte56 Jan 8 at 2:35
show 5 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.