{"id":18004232,"url":"https://github.com/colinleung-nilocat/unityurp-mobiledrawmeshinstancedindirectexample","last_synced_at":"2025-05-16T09:06:12.550Z","repository":{"id":39158226,"uuid":"282309203","full_name":"ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample","owner":"ColinLeung-NiloCat","description":"Example project to draw 1million grass instances on mobile","archived":false,"fork":false,"pushed_at":"2020-11-25T15:47:14.000Z","size":3209,"stargazers_count":1604,"open_issues_count":4,"forks_count":248,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-09T04:04:33.660Z","etag":null,"topics":["grass","indirect","instancing","mobile","unity","urp"],"latest_commit_sha":null,"homepage":"https://youtu.be/A7rav4tS88s","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColinLeung-NiloCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-24T20:22:13.000Z","updated_at":"2025-04-08T06:09:10.000Z","dependencies_parsed_at":"2022-07-11T20:47:12.188Z","dependency_job_id":null,"html_url":"https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinLeung-NiloCat%2FUnityURP-MobileDrawMeshInstancedIndirectExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinLeung-NiloCat%2FUnityURP-MobileDrawMeshInstancedIndirectExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinLeung-NiloCat%2FUnityURP-MobileDrawMeshInstancedIndirectExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinLeung-NiloCat%2FUnityURP-MobileDrawMeshInstancedIndirectExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinLeung-NiloCat","download_url":"https://codeload.github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501558,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grass","indirect","instancing","mobile","unity","urp"],"created_at":"2024-10-30T00:13:43.424Z","updated_at":"2025-05-16T09:06:07.541Z","avatar_url":"https://github.com/ColinLeung-NiloCat.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnityURP-MobileDrawMeshInstancedIndirectExample\n\nyoutube runtime demo video: https://youtu.be/A7rav4tS88s  \ndownload .apk, try it on your android phone: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view\n\n DrawMeshInstancedIndirect ON\n ![screenshot](https://i.imgur.com/oQoFK46.png)\n DrawMeshInstancedIndirect ON (grass bending)\n ![screenshot](https://i.imgur.com/QDXbEZw.png)\n ![screenshot](https://i.imgur.com/E7wEEPR.png)\n DrawMeshInstancedIndirect OFF\n ![screenshot](https://i.imgur.com/xOhTW6d.png)\n \n Why create this repository?\n -------------\n To demonstrate an API that can draw millions of instance -\u003e DrawMeshInstancedIndirect(), running on mobile devices.\n \n Can this demo runs on midrange mobile?\n---------------\n- can handle 10 million instances on Samsung Galaxy A70 (GPU = adreno612, not a strong GPU), 50~60fps, performance mainly affected by visible grass count on screen(draw distance = 125)\n- can handle 10 million instances on Lenovo S5 (GPU = adreno506, a weak GPU), 30fps, performance mainly affected by visible grass count on screen(draw distance = 75)\n \n Requirement\n -----------------\n if you want to try the pre-built .apk, your android device must support Opengles3.2 / Vulkan  \n download .apk: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view\n \n Where are the important files\n ----------------\n https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/tree/master/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core\n \n Editor\n ------------\n 2019.4.15f1\n \n Note\n -------------\n This is a simplified example repository to demonstrate DrawMeshInstancedIndirect API on mobile platform.  \n This repository is as simple as possible, only contains a simple CPU cell frustum culling(not even a quadtree) -\u003e minimum compute GPU frustum culling (no Acceleration Algorithms), then just 1 DrawMeshInstancedIndirect call, nothing else, code is very short.\n \n Lighting and animation is not the main focus of this project, but ~40% of the time was spent on writing grass shader's lighting \u0026 animation, you can have a look at  InstancedIndirectGrass.shader if you are interested.  \n \n This repository also contains a RendererFeature(GrassBendingRTPrePass.cs) to render an offscreen RT(R8), which renders top down view grass bending area (by trail renderer following moving objects), it is a very simple method but the result is good enough for this demo.\n \nreference\n-------------------\n- https://github.com/ellioman/Indirect-Rendering-With-Compute-Shaders\n- https://github.com/tiiago11/Unity-InstancedIndirectExamples\n- https://assetstore.unity.com/packages/tools/utilities/gpu-instancer-117566\n- https://assetstore.unity.com/packages/tools/terrain/advanced-terrain-grass-100014\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinleung-nilocat%2Funityurp-mobiledrawmeshinstancedindirectexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinleung-nilocat%2Funityurp-mobiledrawmeshinstancedindirectexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinleung-nilocat%2Funityurp-mobiledrawmeshinstancedindirectexample/lists"}