Grass Fields in Unity URP! Generate Blades with Compute Shaders! ✔️ 2020.3 | Game Dev Tutorial @NedMakesGames
Grass Fields in Unity URP! Generate Blades with Compute Shaders! ✔️ 2020.3 | Game Dev Tutorial  @NedMakesGames
Uploaded December 2020 | Updated September 2026, 3 weeks ago
✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3
🩹 Fixes:
► Make sure your source mesh has read/write enabled in it's asset importer inspector.

Grass is a tough thing to render for any game. I've shown two ways to do it, and here's a third approach! This uses a compute shader to extrude a blade of grass from each triangle on a source mesh. The blades dynamically simplify when far from the camera, helping you to create large fields, and wave with the wind too.

👋 Subscribe for weekly game development videos!
youtube.com/c/nedmakesgames?sub_confirmation=1

👑 Join my Patreon for extra influence over topics, early access to videos, and downloadable project files!
► patreon.com/nedmakesgames

🔗 Check out my website for a searchable list of tutorials!
► nedmakesgames.github.io

🔴 Twitch ► twitch.tv/nedmakesgames
🐦 Twitter ► twitter.com/nedmakesgames
🎮 Discord ► discordapp.com/invite/ubxSVBK
📸 Instagram ► instagram.com/nedmakesgames
👽 Reddit ► reddit.com/u/nedmakesgames
🎶 TikTok ► tiktok.com/@nedmakesgames
☕ Ko-fi ► ko-fi.com/nedmakesgames

🎬 Previous videos
► Compute shader basics: youtu.be/EB5HiqDl7VE
► Cross-mesh grass in shader graph: youtu.be/JDpt9xYaUYc
► Geometry shader layered grass: youtu.be/YghAbgCN8XA
► Compute shader layered grass: youtu.be/c1JThTu6-Ok

✨Follow up videos
► Trample effects on cross mesh grass: youtu.be/AmO7k-Lr0XM
► Improved blade grass: youtu.be/6SFTcDNqwaA

📜 Required scripts
► NMGGrassBladeComputeHelpers.hlsl: gist.github.com/NedMakesGames/2531d460febb0406b812726e1b328e0d
► NMGGrassBladeGraphicsHelpers.hlsl: gist.github.com/NedMakesGames/53e477ce920ace08413dbbedc1f06c87

📚 Reference scripts
► Base: gist.github.com/NedMakesGames/3e67fabe49e2e3363a657ef8a6a09838
► Randomization: gist.github.com/NedMakesGames/229dc9ed7ccaebfff4f6ac192c5125ef
► Segments: gist.github.com/NedMakesGames/b380a98f405cbf0fbbf8ffcec276c488
► Wind: gist.github.com/NedMakesGames/cac5fea97b775aab3ba3c069d660f4ab
► Instantiation: gist.github.com/NedMakesGames/b4e4ec90b67ee3b92ef1b561475c2b58
► LOD: gist.github.com/NedMakesGames/92a4cafe345a330f9a94069ffcec7dc8

⏲️ Timestamps:
0:00 Intro
0:44 Project setup
1:30 Base scripts
10:34 Randomization
12:48 Segments
15:54 Wind
18:26 Instantiation
19:17 LOD
20:58 Wrap up and credits

🎖️ Credits and references:
• Roystan: Grass Shader - roystan.net/articles/grass-shader.html
• CJT-Jackson: URP Geometry Shader Example - github.com/CJT-Jackton/URP-Geometry-Shader-Example
• Keijiro Takahashi: AngleAxis3x3 - gist.github.com/keijiro/ee439d5e7388f3aafc5296005c8c3f33
• Ronja Böhringer: White Noise - ronja-tutorials.com/2018/09/02/white-noise.html
• Siddharth Hegde: Messing with Tangent Space - gamasutra.com/view/feature/129939/messing_with_tangent_space.php?print=1
• freepik: Wrinkled paper texture - freepik.com/premium-vector/wrinkled-paper-texture_711440.htm
• benblo: TransformBounds - answers.unity.com/questions/361275/cant-convert-bounds-from-world-coordinates-to-loca.html
• DuncanF - Lockless marching cubes with DrawProceduralIndirect - gist.github.com/DuncanF/353509dd397ea5f292fa52d1b9b5133d
• Kevin Hartnell: music "The 13th Nocturne" - freemusicarchive.org/music/Kevin_Hartnell/CC_BY-SA_40/Kevin_Hartnell_-_CC_BY-SA_40_-_15_The_13th_Nocturne

#GameDev #IndieDev #Unity
Grass Fields in Unity URP! Generate Blades with Compute Shaders! ✔️ 2020.3 | Game Dev TutorialIntro to Compute Shaders in Unity URP! Replace Geometry Shaders ✔️ 2020.3 | Game Dev TutorialNo Kicking Yourself! Tactical Lizard Tamer, Unity Game Dev Log [Part 186]Boulders and Art Styles! Tactical Lizard Tamer, Unity Game Dev Log [Part 142]Transparent and Crystal Clear | Writing Unity URP Code Shaders Tutorial [3/9] #shortsRim Lights and Cookies! Tactical Lizard Tamer, Unity Game Dev Log [Part 126]Smoothing Margins! Tactical Lizard Tamer, Unity Game Dev Log [Part 130A]Cel Shading with Shadows! Tactical Lizard Tamer, Unity Game Dev Log [Part 127]Deferred Toon Shader! Tactical Lizard Tamer, Unity Game Dev Log [Part 122]Custom Lighting in Unity URP Shader Graph! Ready for Toony Lights! ✔️ 2021.1 | Game Dev TutorialSetting Animator Parameters! Tactical Lizard Tamer, Unity Game Dev Log [Part 108]Get a Callback When Files Change with Unitys OnPostproccessAllAssets ✔️ 2020.3 | Game Dev Tutorial
Ned Makes Games |

Grass Fields in Unity URP! Generate Blades with Compute Shaders! ✔️ 2020.3 | Game Dev Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER