✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3 🩹 Fixes
► At line 39 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 improve edge detection outlines by incorporating depth normals. I also refine the outlines, eliminating artifacts on far away objects. In the process, I show how to write a renderer feature to generate the depth normal texture and compute view direction from a screen space UV.
👋 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
► Edge detection outlines part 1: • Toon Outlines in Unity URP, Shader Gr...
► Hull outlines: • Hull Outline Shader in Unity URP Usin...
✨Follow up videos
► Single object outlines: • Outlines on One Object in Unity URP S...
► Optimized outlines: • Optimized Toon Outlines! One Texture ...
📜 Required scripts
► BlitMaterialFeature.cs: https://github.com/NedMakesGames/Rend...
► DecodeDepthNormals.hlsl: https://gist.github.com/NedMakesGames...
📚 Reference scripts
► Initial setup: https://gist.github.com/NedMakesGames...
► Final project: https://gist.github.com/NedMakesGames...
⏲️ Timestamps:
0:00 Intro
0:34 Project setup
0:53 Depth normals feature
4:29 Adding normals edge outlines
7:07 Shallow angle adjustments
10:25 Non-linear depth adjustments
11:13 Far away normals adjustments
12:11 Optimizations
12:38 Wrap up and credits
🎖️ Credits and references:
• Cyanilux: Depth - https://www.cyanilux.com/tutorials/de...
• Roystan: Outline Shader - https://roystan.net/articles/outline-...
• Alex Ameye: Outline Shader - https://alexanderameye.github.io/outl...
• POPA_3D: Gift Box with Red rubbons [sic] - https://www.turbosquid.com/3d-models/...
• hushnow: SNOWMAN - https://free3d.com/3d-model/snowman-6...
• Ben Golus and Keijiro Takahashi: Converting screen space UV to view direction - https://forum.unity.com/threads/help-...
• freepik: Wrinkled paper texture - https://www.freepik.com/premium-vecto...
• Hanane Rami, Mohammed Hamri, Lhoussiene Masmoudi: Color Edge Detector with Sobel-PCA - https://citeseerx.ist.psu.edu/viewdoc...
• Microsoft: DirectX Graphics Samples - https://github.com/microsoft/DirectX-...
• Eric Skiff: music "We're the Resistors" - https://freemusicarchive.org/music/Er...
#GameDev #IndieDev #Unity