# is instanced rendering faster? [closed]

Is instanced rendering used in GLSL faster than doing something like this..

for(int i=0; i<10; i++)
{
glDrawArrays(GL_POINTS, 0, 3000);
}


Suppose I want to render 'grass', which is the best way when it comes to render one geometry multiple times.

## closed as too broad by Anko, bummzack, concept3d, Philipp, Josh♦Dec 16 '13 at 17:23

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• It depends. The question is too broad. – Bartek Banachewicz Dec 12 '13 at 14:33

Only way to know is to profile the outcome.

Bascily this is faster, but when you have plenty of smaller objects that you only draw one-two objects of are usualy slower, but the bigger gain of the rest of the objects might give you higher gain which will hide this "penalty".

A rule of the thumb is to keep both ways around and imagine go for a minimum litmit with instancing. in other words, if X > 10 -> instancing, X < 10 single drawcalls.

But then again, it all comes down to profiling. only way to tell, only way to know.

• Nice, i am trying to render grass, so its gonna be instancing. Cheers :) – 2am Dec 12 '13 at 14:32
• For grass, i would even go with geometry shader, that way you can just create it on the fly without any bigger cpu overhead. – Tordin Dec 12 '13 at 14:34
• hmm, interesting, I haven't really read much about geometry shaders, but i am aware of their usage. I will read about them tonight! :) – 2am Dec 12 '13 at 14:59
• Depends on driver and hardware. A few years ago the instancing was slower than not-instancing while instancing was faster with D3D on the same machine. Especially with GL, performance is hard to predict. – Sean Middleditch Dec 12 '13 at 20:48
• Thats why you really have to profile what is faster. – Tordin Dec 13 '13 at 8:42