4
$\begingroup$

I have been reading a lot of debate on a new feature that will be available in the new version of the game engine Unity 5.4 - called GPU instancing. I understand the importance of instancing in general, both in terms of saving memory and draw calls.

However, even after doing some reading, I still couldn't understand what exactly are the differences between GPU instancing and non-GPU instancing - and, more importantly, where the alleged GPU advantages in terms of performance come from in comparison to standard instancing.

Thanks for your knowledge and for any references.

$\endgroup$
  • 2
    $\begingroup$ I'm not aware of any distinction between "GPU instancing" and "standard instancing". As far as I'm aware, there's only one kind of instancing and it is a GPU feature. Whatever this is, it's probably something specific to Unity (and perhaps a term made up by Unity marketing), and you might have to track down a Unity engineer to get an explanation of what the new feature really is. $\endgroup$ – Nathan Reed Jun 9 '16 at 7:50
  • $\begingroup$ By 'standard instancing', could they be referring to just having one copy of the mesh in system memory? That sounds rather elementary to any game engine. It also seems odd that they didn't have GPU instancing until now. $\endgroup$ – Rotem Jun 9 '16 at 7:55
  • $\begingroup$ @Rotem Those were exactly my thoughts and the origin of my question. See here in their roadmap what they say about it: unity3d.com/pt/unity/beta/unity5.4.0b1 And yes, the only thing I can think of is that their "non-GPU" instancing is a copy of mesh in RAM, which is quite a ppor way of doing that. As per the link I sent, it seems that now they are firstly introducing the possibility of instancing using shaders, i.e. directly in the GPU $\endgroup$ – Louis15 Jun 9 '16 at 12:22
  • 1
    $\begingroup$ If the mesh moves and needs to be drawn in many places then one could instantiate it by reusing the draw calls and not redo mesh deformations. Used to be done in ages past ages. $\endgroup$ – joojaa Jun 9 '16 at 20:23
1
$\begingroup$

Unity provides a pretty clear description of GPU instancing. It is exactly the same as instancing. Employees of Unity even spell this out by initially arguing against it years ago before finally implementing it.

Before this, Unity solely relied on batching, which was a technique that combined meshes together into one to reduce draw calls.

$\endgroup$
0
$\begingroup$

My understanding is that in 5.4, instancing will use API calls like glDrawElementsInstanced and shaders need to be modified for instance buffers like in this document: Basic GPU Instancing Support | docs.google.com

UNITY_INSTANCING_CBUFFER_START (MyProperties)

UNITY_DEFINE_INSTANCED_PROP (float4, _Color)

UNITY_INSTANCING_CBUFFER_END

$\endgroup$
  • 1
    $\begingroup$ Could you also explain how this differs from standard instancing? $\endgroup$ – trichoplax Jun 11 '16 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.