{"repo":"MangoButtermilch/Unity-Grass-Instancer","free":true,"listed":false,"github":"https://github.com/MangoButtermilch/Unity-Grass-Instancer","clone":"git clone https://github.com/MangoButtermilch/Unity-Grass-Instancer.git","description":"Unity multiple approaches for GPU instanced grass (+ occlusion/frustum culling)","language":"C#","stars":333,"topics":["frustum-culling","gpu","grass","instancing","shader","unity","occlusion-culling"],"license":"MIT","category":"game-templates","readme_excerpt":"Unity Grass Instancer Contains C# scripts and shaders for GPU instanced grass (or any other mesh) Made with Unity 2020.3.4f1 and HDRP 10.4.0 Also tested with Unity 2022.3.40f1 and URP 14.0.11 Unity 6 and URP 17.0.3 Video showcase: https://www.youtube.com/watch?v=4A0QP5x0MOE Project contains 6 approaches (Performance increases every step) - (old) Plain instanced rendering using DrawMeshInstanced and DrawMeshInstancedIndirect without any optimizations (click here to read more) - Frustum culled approach (click here to read more) - Frustum culled approach with chunking (click here to read more) - Occlusion culled approach with frustum culling and chunking (click here to read more) - High performance approach that extends all others (click here to read more) - Infinite grass rendering (click here to read more) Requirements - Any render pipeline (only URP and simple HDRP shader provided) - A terrain - SRP Batcher needs to be disabled - Enable GPU instancing on the material Setup - Drag the 3D Model + the scripts of any approach into your project - Adjust the 3D model scale factor in the import settings to 100 - Create a new material and assign the shader - Attach the script to an empty game object - enable draw gizmos - position it at the center of your terrain - configure the range so it fits your terrain size Important settings Note: some settings don't apply to all approaches. - Instances - The amount of grass blades that can be instanced. Works best with powers of 2 - True inst","default_branch":null,"files":null,"tree":[],"storefront":"/r/MangoButtermilch","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MangoButtermilch/Unity-Grass-Instancer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}