Toon Outlines in Unity URP, Shader Graph Using Sobel Edge Detection! ✔️ 2020.3 | Game Dev Tutorial

Опубликовано: 04 Апрель 2026
на канале: Ned Makes Games
79,699
1.7k

✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3
🩹 Fixes
► I made an editing mistake around 1:30. Please note, you need to place the outline material into the material field of the BlitMaterialFeature. It should not be empty after this step. Sorry about that!
► At line 35 in EdgeDetectionOutlinesInclude.hlsl, the sixth entry in sobelSamplePoints should be float2(1, 0), not float2(1, 1)
For 2020.2:
► When you create a shader graph, set the material setting to "Unlit"
► The gear menu on Custom Function nodes is now in the graph inspector
► Editing properties must be done in the graph inspector instead of the blackboard

Outlines are a great way to add polish and style to a variety of games! In this tutorial, I show how to implement sobel edge detection outlines in Unity Universal Render Pipeline using a combination of a shader graph and a renderer feature. These outlines affect the entire screen, do not change based on perspective, and can accentuate changes in color!

👋 Subscribe for weekly game development videos!
https://www.youtube.com/c/nedmakesgam...

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

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

🔴 Twitch ►   / nedmakesgames  
🐦 Twitter ►   / nedmakesgames  
🎮 Discord ► https://discordapp.com/invite/ubxSVBK
📸 Instagram ►   / nedmakesgames  
👽 Reddit ►   / nedmakesgames  
🎶 TikTok ►   / nedmakesgames  
☕ Ko-fi ► https://ko-fi.com/nedmakesgames

🎬 Previous videos
► Hull outlines:    • Hull Outline Shader in Unity URP Using Ren...  
► Introduction to renderer features:    • Intro Renderer Feature in Unity URP - Desa...   and    • Control Custom Renderer Features in a Scri...  

✨ Follow up videos
► Depth normals outlines:    • More Toon Outlines! Normal Edge Detection ...  
► Single object outlines:    • Outlines on One Object in Unity URP Shader...  
► Optimized outlines:    • Optimized Toon Outlines! One Texture For D...  

📜 Required scripts
► BlitMaterialFeature.cs: https://github.com/NedMakesGames/Rend...

📚 Reference scripts
► Depth only: https://gist.github.com/NedMakesGames...
► Final: https://gist.github.com/NedMakesGames...

⏲️ Timestamps:
0:00 Intro
0:40 Project setup
1:35 Depth edge detection
8:05 Color edge detection
10:45 Wrap up and credits

🎖️ Credits and references:
• Microsoft: DirectX-Graphics-Samples - https://github.com/microsoft/DirectX-...
• Hanane Rami, Mohammed Hamri and Lhoussiene Masmoudi: Color Edge Detector with Sobel - https://citeseerx.ist.psu.edu/viewdoc...
• Unity Technologies: Universal Rendering Examples - https://github.com/Unity-Technologies...
• Alex Ameye: Outline Shader - https://alexanderameye.github.io/outl...
• polyperfect: Low Poly Ultimate Pack - https://assetstore.unity.com/packages...
• freepik: Wrinkled Paper Texture - https://www.freepik.com/premium-vecto...
• M_Studios: Flower Vase - https://www.turbosquid.com/3d-models/...
• Visager: music "In the Branches [Loop]" - https://freemusicarchive.org/music/Vi...

#GameDev #IndieDev #Unity