{"id":734,"date":"2019-11-18T16:48:00","date_gmt":"2019-11-18T08:48:00","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=734"},"modified":"2020-09-26T22:42:51","modified_gmt":"2020-09-26T14:42:51","slug":"unityskinnedmeshrenderer%e6%94%af%e6%8c%81gpu-instancing","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=734","title":{"rendered":"[Unity]SkinnedMeshRenderer\u652f\u6301GPU-Instancing"},"content":{"rendered":"\n<p>Unity\u7684SkinnedMeshRender\u4e0d\u652f\u6301GPU-Instancing\uff0c\u5b98\u65b9\u5728Github\u4e0a\u53d1\u5e03\u4e86\u4e00\u79cd\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/blogs.unity3d.com\/cn\/2018\/04\/16\/animation-instancing-instancing-for-skinnedmeshrenderer\/\">https:\/\/blogs.unity3d.com\/cn\/2018\/04\/16\/animation-instancing-instancing-for-skinnedmeshrenderer\/<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Unity-Technologies\/Animation-Instancing\" target=\"_blank\"><strong>github.com\/Unity-Technologies\/Animation-Instancing<\/strong><\/a><\/p>\n\n\n\n<p> As developers, we\u2019re always aware of performance, both in terms of CPU and GPU. Maintaining good performance gets more challenging as scenes get larger and more complex, especially as we add more and more characters. Me and my colleague in Shanghai come across this problem often when helping customers, so we decided to dedicate a few weeks to a project aimed to improve performance when instancing characters. We call the resulting technique Animation Instancing. <\/p>\n\n\n\n<p>We often implement outdoors scenes with&nbsp;<a href=\"https:\/\/docs.unity3d.com\/Manual\/GPUInstancing.html\">GPU Instancing<\/a>, such as grasses and trees. But for&nbsp;<a href=\"https:\/\/docs.unity3d.com\/Manual\/class-SkinnedMeshRenderer.html\">SkinnedMeshRenderer<\/a>&nbsp;(for example characters), we can\u2019t use instancing, because the skinning is calculated on the CPU, and submitted to the GPU one by one. In general, we can\u2019t draw all characters through one submission. When there are lots of SkinnedMeshRenderers in the scene, this results in lots of draw calls and animation calculations.<\/p>\n\n\n\n<p>We have found a way to reduce CPU cost and supplement GPU Instancing in Unity with Animation Instancing. You can&nbsp;<a href=\"https:\/\/github.com\/Unity-Technologies\/Animation-Instancing\">get our code on GitHub<\/a>.&nbsp;Be aware that this is custom experimental solution, we\u2019ve only shared it with a few of our enterprise support customers until recently. Now we\u2019re ready for more feedback \u2013&nbsp;please let us know what you think&nbsp;<a href=\"https:\/\/github.com\/Unity-Technologies\/Animation-Instancing\/issues\">directly in the project comments<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity\u7684SkinnedMeshRender\u4e0d\u652f\u6301GPU-Instancing\uff0c\u5b98\u65b9\u5728Github\u4e0a\u53d1\u5e03\u4e86\u4e00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/734"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=734"}],"version-history":[{"count":1,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/734\/revisions"}],"predecessor-version":[{"id":735,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/734\/revisions\/735"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}