One question comes to me about GPU Instancing recently when I am studying game performance optimization stuffs:
Generally, do GPU Instancing always bring performance boost, compared to equivalent single mesh drawcalls for centern number of instances?
I am not sure that this is a proper question. Or maybe there is even no ‘general’ circumstance to think about comparision between GPU Instancing and single mesh drawcall. Actually, I want to know what GPU Instancing can really boost and it’s tradeoff. I know that typically we use GPU Instancing when a program/an application encounters CPU-bound performance issue when rendering. In such a case, we originally draw, for example, 10000 mesh instances with 10000 single mesh drawcalls, while we only need one drawcall via GPU Instancing.
We say there are N instances in my scene with the same mesh and material information, but with different ObjectToWorld Space Transformation matrix and per-instance data for rendering. From my perspective, if I use N single mesh drawcall method, CPU need to upload matrix and per-instance data to GPU for each instance and also launch a drawcall for each. But if GPU Instancing applied, I can put all matrix and instance data in vertex buffer, and upload them to GPU once. And then one drawcall is made. I think, for the same size of data, uploading them in one chunk is faster then uploading them in several subchunks. And also one drawcall should be better than bunch of drawcalls. If my understanding above is right, it seems that GPU Instancing should be always used when rendering several instances if they meet GPU Instancing requi rements. Otherwise, what drawbacks do GPU Instancing have?