Hi,
First off, I would like to mention that I feel that I understand what instancing is, and somewhat when the best times to use is would be, more or less.
And I’ve come to the conclusion that instancing would be better overall than looping several hundred/thousand times in my case.
How ever, I’m a bit stumped when it comes to passing certain data. Matrix data for each instance.
The book I’m reading is using an example of drawing four squares, with instanced positions and colors.
The colors and positions are hard coded and passed to the GPU during the stage in which you create a VAO and VBO, and pass the relevant data. It doesn’t seem to use interleaving, where as for my data, I am.
In my situation, with what I’m thinking (of which may not be the best solution).
Is that I have the same space ship model, but I want it rendered in different places, with different rotations, so I figured the easiest way is to have everything permanent (vert positions, normals, uvs), but have a model matrix be instanced. But I don’t create and initialize all ships at the beginning (when I create the VAO and VBO for that object).
So overall, I’m unsure with how I go about it. When it’s not hard-coded, but dynamic.
If I’m unclear in what I’m stuck with, I apologize, it’s rather difficult to for me to put into words.