{"id":74,"date":"2024-09-23T12:00:00","date_gmt":"2024-09-23T12:00:00","guid":{"rendered":"https:\/\/unity3dperformance.com\/?p=74"},"modified":"2024-09-29T18:43:13","modified_gmt":"2024-09-29T18:43:13","slug":"optimizing-draw-calls-unity3d","status":"publish","type":"post","link":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/","title":{"rendered":"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game&#8217;s Performance with GPU Instancing"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>Game performance in Unity3D is crucial, especially in large projects with complex environments. One common issue developers face is an excessive number of <strong>draw calls<\/strong> \u2013 commands sent to the graphics card, which significantly impact game smoothness. In this article, we will discuss how to reduce draw calls using <strong>GPU Instancing<\/strong> and improve your game&#8217;s performance.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Are Draw Calls and Batches?<\/strong><\/h2>\n\n\n\n<p>Before diving into optimization details, it&#8217;s important to understand the difference between <strong>draw calls<\/strong> and <strong>batches<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Draw Call<\/strong> \u2013 This is a rendering instruction sent by Unity to the graphics card to display an object on the screen. Each object that needs to be drawn generates a new draw call.<\/li>\n\n\n\n<li><strong>Batch<\/strong> \u2013 A batch is a group of objects rendered simultaneously within a single draw call. The more objects Unity can combine into one batch, the fewer draw calls are generated, which increases rendering efficiency.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Excessive Draw Calls Slow Down Your Game<\/strong><\/h2>\n\n\n\n<p>The more draw calls there are, the greater the load on the graphics card. In games with large, complex environments, such as open worlds filled with foliage, rocks, and buildings, draw calls can quickly multiply, leading to a decrease in frames per second (FPS).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How GPU Instancing Works in Unity3D<\/strong><\/h2>\n\n\n\n<p><strong>GPU Instancing<\/strong> is a rendering optimization technique that allows multiple identical objects to be displayed using a single draw call. Instead of rendering each object separately, Unity groups repeated elements (such as trees, rocks, fences) and renders them in one batch.<\/p>\n\n\n\n<p>Enabling <strong>GPU Instancing<\/strong> in Unity is straightforward: simply check the <strong>&#8220;Enable GPU Instancing&#8221;<\/strong> option in the material settings, allowing the engine to combine identical objects into one batch.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step-by-Step: Optimizing in Unity3D Using GPU Instancing<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Check Materials<\/strong> \u2013 Ensure that repeated objects in the scene (e.g., trees, rocks, grass) use the same material.<\/li>\n\n\n\n<li><strong>Enable GPU Instancing<\/strong> \u2013 In the material settings, check the &#8220;Enable GPU Instancing&#8221; option. Unity will start grouping identical objects into one batch.<\/li>\n\n\n\n<li><strong>Test Results<\/strong> \u2013 After enabling GPU Instancing, check the game statistics again. You should see a significant reduction in the number of draw calls, which should lead to smoother gameplay.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example Before and After Optimization<\/h2>\n\n\n\n<p>Below, you can see an example of a scene <strong>before<\/strong> optimization, where the number of draw calls was high due to many identical objects being rendered separately.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8-1024x477.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Scene view before enabling GPU Instancing, showing high draw calls<\/figcaption><\/figure>\n\n\n\n<p>After applying GPU Instancing, the number of batches and draw calls dropped significantly, contributing to increased game performance. Below is an image <strong>after<\/strong> optimization.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-9-1024x480.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Scene view after applying GPU Instancing, with significantly reduced draw calls.<\/figcaption><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Why GPU Instancing is Key to Better Performance<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Increased Game Performance<\/strong> \u2013 Reducing the number of draw calls means less strain on the GPU, resulting in higher FPS and smoother gameplay. This is especially critical in games with large, open worlds.<\/li>\n\n\n\n<li><strong>Rendering Optimization<\/strong> \u2013 Enabling GPU Instancing allows Unity to group identical objects, reducing both batches and draw calls. As a result, the game becomes more responsive.<\/li>\n\n\n\n<li><strong>Easy Implementation<\/strong> \u2013 This technique is very easy to apply. Just check the option in the material settings for immediate benefits.<\/li>\n\n\n\n<li><strong>Scalability<\/strong> \u2013 GPU Instancing works well in projects that need to run on various devices, from computers to consoles and mobile devices. Fewer draw calls mean lower resource consumption across all platforms.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-medium-font-size\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Optimizing the number of <strong>draw calls<\/strong> in Unity3D is essential for improving game performance, especially in scenes with many repeated objects. Enabling <strong>GPU Instancing<\/strong> is one of the simplest and most effective solutions to reduce rendering load and enhance game smoothness.<\/p>\n\n\n\n<p>With this technique, your game can run faster and smoother, even with a high number of objects on screen. If your game struggles with performance issues, consider trying GPU Instancing \u2013 the results can be surprisingly good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Game performance in Unity3D is crucial, especially in large projects with complex environments. One common issue developers face is an excessive number of draw calls \u2013 commands sent to the graphics card, which significantly impact game smoothness. In this article, we will discuss how to reduce draw calls using GPU Instancing and improve your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[15,12,14],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-unity-optimization","tag-gpuinstancing","tag-gpuperformance","tag-renderingperformance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Optimizing Draw Calls in Unity3D \u2013 Boost Your Game&#039;s Performance with GPU Instancing - Unity3D Performance Blog<\/title>\n<meta name=\"description\" content=\"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game&#039;s Performance with GPU Instancing - Unity3D Performance Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/\" \/>\n<meta property=\"og:site_name\" content=\"Unity3D Performance Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-23T12:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-29T18:43:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8-1024x477.png\" \/>\n<meta name=\"author\" content=\"Rufi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rufi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/\",\"url\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/\",\"name\":\"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game's Performance with GPU Instancing - Unity3D Performance Blog\",\"isPartOf\":{\"@id\":\"https:\/\/unity3dperformance.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8-1024x477.png\",\"datePublished\":\"2024-09-23T12:00:00+00:00\",\"dateModified\":\"2024-09-29T18:43:13+00:00\",\"author\":{\"@id\":\"https:\/\/unity3dperformance.com\/#\/schema\/person\/1296fd7575f681c85a3afc18bf973b0c\"},\"description\":\"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.\",\"breadcrumb\":{\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage\",\"url\":\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8.png\",\"contentUrl\":\"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8.png\",\"width\":1920,\"height\":894},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/unity3dperformance.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimizing Draw Calls in Unity3D\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unity3dperformance.com\/#website\",\"url\":\"https:\/\/unity3dperformance.com\/\",\"name\":\"Unity3D Performance Blog\",\"description\":\"Discover tips and techniques to optimize your Unity3D projects for better performance and efficiency.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unity3dperformance.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/unity3dperformance.com\/#\/schema\/person\/1296fd7575f681c85a3afc18bf973b0c\",\"name\":\"Rufi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/unity3dperformance.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f1f6db23df2ef8fe5ff6875fbab10a67f1fcfef48afa45d5c00ed04d0ccf792?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f1f6db23df2ef8fe5ff6875fbab10a67f1fcfef48afa45d5c00ed04d0ccf792?s=96&d=mm&r=g\",\"caption\":\"Rufi\"},\"sameAs\":[\"http:\/\/unity3dperformance.com\"],\"url\":\"https:\/\/unity3dperformance.com\/index.php\/author\/admin2826\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game's Performance with GPU Instancing - Unity3D Performance Blog","description":"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/","og_locale":"en_US","og_type":"article","og_title":"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game's Performance with GPU Instancing - Unity3D Performance Blog","og_description":"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.","og_url":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/","og_site_name":"Unity3D Performance Blog","article_published_time":"2024-09-23T12:00:00+00:00","article_modified_time":"2024-09-29T18:43:13+00:00","og_image":[{"url":"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8-1024x477.png"}],"author":"Rufi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rufi","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/","url":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/","name":"Optimizing Draw Calls in Unity3D \u2013 Boost Your Game's Performance with GPU Instancing - Unity3D Performance Blog","isPartOf":{"@id":"https:\/\/unity3dperformance.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage"},"image":{"@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage"},"thumbnailUrl":"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8-1024x477.png","datePublished":"2024-09-23T12:00:00+00:00","dateModified":"2024-09-29T18:43:13+00:00","author":{"@id":"https:\/\/unity3dperformance.com\/#\/schema\/person\/1296fd7575f681c85a3afc18bf973b0c"},"description":"Learn how to optimize draw calls in Unity3D using GPU Instancing to improve game performance. Reduce batches and enhance rendering efficiency in your game environments.","breadcrumb":{"@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#primaryimage","url":"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8.png","contentUrl":"https:\/\/unity3dperformance.com\/wp-content\/uploads\/2024\/09\/obraz-8.png","width":1920,"height":894},{"@type":"BreadcrumbList","@id":"https:\/\/unity3dperformance.com\/index.php\/2024\/09\/23\/optimizing-draw-calls-unity3d\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/unity3dperformance.com\/"},{"@type":"ListItem","position":2,"name":"Optimizing Draw Calls in Unity3D"}]},{"@type":"WebSite","@id":"https:\/\/unity3dperformance.com\/#website","url":"https:\/\/unity3dperformance.com\/","name":"Unity3D Performance Blog","description":"Discover tips and techniques to optimize your Unity3D projects for better performance and efficiency.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unity3dperformance.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/unity3dperformance.com\/#\/schema\/person\/1296fd7575f681c85a3afc18bf973b0c","name":"Rufi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/unity3dperformance.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f1f6db23df2ef8fe5ff6875fbab10a67f1fcfef48afa45d5c00ed04d0ccf792?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f1f6db23df2ef8fe5ff6875fbab10a67f1fcfef48afa45d5c00ed04d0ccf792?s=96&d=mm&r=g","caption":"Rufi"},"sameAs":["http:\/\/unity3dperformance.com"],"url":"https:\/\/unity3dperformance.com\/index.php\/author\/admin2826\/"}]}},"_links":{"self":[{"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":4,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions\/211"}],"wp:attachment":[{"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unity3dperformance.com\/index.php\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}