Register
handmade.network»Forums»OpenGL Instanced Rendering Every Object
1 posts
OpenGL Instanced Rendering Every Object
5 days, 15 hours ago Edited by brack123 on Jan. 13, 2020, 10:57 a.m.
So, normally in OpenGL if we wanted to render 2000 of an object, we would call glDrawArrays 2000 times. Instanced rendering allows us to make a draw call only a single time, leading to less CPU overhead per draw call.

Therefore, it seems to me that we would always want to use instanced rendering for all objects, as opposed to only things like particles, etc. However, I read online that instanced rendering is actually worse when you have few instances. For example, if instead of 2000 of an object, we only had 5. I don't understand why this is the case (if it's even true) and would like some clarification if possible.

I suppose the question is: Does the DrawArraysInstanced method have any extra overhead, such that if we only draw one (or a small number of) instances of a lot of different models, it actually yields a performance hit? If not, does that mean DrawArrayInstanced is always a better (as in, scalable) function than DrawArrays?

Thanks