Unity animation object with gpu instancing.
Unity animation object with gpu instancing.
based on theory: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch02.html
Chapter 2. Animated Crowd Rendering.
DxPortfolioProject Same technique with DirectX11 that I've developed.
Created with Unity 2017.1.3f1. (At least you need 5.4 which supports Gpu Instancing)
https://docs.unity3d.com/Manual/GPUInstancing.html
basically, you can use Graphics.DrawMeshInstanced with your mesh data, or you can use MeshRenderer which supports instancing with some of preparations in your shader.
When you use GPU instancing, the following restrictions apply:
Unity automatically picks MeshRenderer components and Graphics.DrawMesh calls for instancing. Note that SkinnedMeshRenderer is not supported.
But, you can`t use Gpu Instancing into SkinnedMeshRenderer - which is animating. This means when you want to draw all same characters at once, Unity draws all of them one on one - such a big performance loss. So I use MeshRenderer for this time.
No open issues yet, or sync has not completed.