Creating a Foliage Shader in Unity URP! Grass, Trees, Flowers, Hedges and More | Game Dev Tutorial

🚀 Download Core to create games for FREE at

✔️ Tutorial tested in Unity URP 2020.3 & 2021.1

Plants, foliage and vegetation are really challenging to get right! It requires a custom made shader to tackle issues like translucency and wind. In this tutorial, I show how to create a foliage shader in the Unity URP (Universal Render Pipeline) Shader Graph. It supports all light types, shadows, and baked lighting, and includes several strategies for translucency, like separate normals for diffuse lighting and subsurface scattering. I also implement programmable wind animation and show a simple method to reconstruct normals. For grass billboards and tree leaf cards, I also demonstrate how to create double sided materials with normal map support.

📚 If you prefer reading, check out the written version of this tutorial here:

✏️ Text-only shader version coming soon!

🌟Previous videos:
► Custom lighting in the shader graph:
► Intro to culling and double sided rendering:
► Creating a grass mesh with a compute shader:

🌞 Interactive lighting math explorer:

👋 Subscribe for weekly game development videos!

👑 Join my Patreon to watch videos early, download all project files, vote on future topics, and more! Thank you so much!

🔗 Visit my website for a searchable list of tutorials!

2️⃣ 2nd Channel ►
🔴 Twitch ►
🐦 Twitter ►
🎮 Discord ►
📸 Instagram ►
👽 Reddit ►
🎶 TikTok ►
☕ Ko-fi ►

💻 Script reference:

⏲️ Timestamps:
0:00 Intro
0:26 Core ad
1:58 Tutorial info
3:35 Project set up
6:41 Two sided rendering
9:27 Shape normals
15:54 Translucent lighting
21:12 Data maps
25:23 Wind
34:14 Normal reconstruction
40:25 Examples
41:23 Wrap up and credits

🎖️ Credits, references and further reading:
• Lee Rosevere: Music for Podcasts –
• Cyanilux: URP_ShaderGraphCustomLighting –
• XfrogPlants: Curry Leaf Tree Free 3D model –
• Ada_King: LowPoly Trees & Carrot & Crystal 3D model –
• Lennart Demes: Grass 001 –
• Baptiste Manteau: Bark old ginko –
• Render Knight: Fantasy Skybox FREE –
• Alan Zucconi: Fast Subsurface Scattering in Unity –
• GetDeadEntertainment: CliffRockTwo 3D model –
• TotallyRonja: Vertex Displacement –
• CatLikeCoding: Rendering 6 (normal mapping) –
• Ben Golus: Normal Mapping for a Triplanar Shader –
• Ben Golus: Generating Perfect Normal Maps for Unity (and Other Programs) –
• Travel Photographer: garden hedges (photo of Atlanta Botanical Garden) –

Neon Laser Horizon by Kevin MacLeod

#GameDev #IndieDev #Unity

Youtube original link

Leave a Reply

Your email address will not be published. Required fields are marked *