Drawing a Line Segment in the URP Shader Graph with 2D SDFs! ✔️ 2021.1 | Unity Game Dev Tutorial @NedMakesGames
Drawing a Line Segment in the URP Shader Graph with 2D SDFs! ✔️ 2021.1 | Unity Game Dev Tutorial  @NedMakesGames
Uploaded June 2021 | Updated September 2026, 3 weeks ago
✔️ Tested in 2020.3 ➕ 2021.1

Drawing lines in shaders can be useful for procedural materials, dynamic UI or HUD elements, or interactive visual effects. In this video, I show how to draw them in Unity's URP Shader Graph using 2D signed distance fields, or SDFs. I also derive the SDF formula and explain the math behind it.

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

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

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

2️⃣ 2nd Channel ► youtube.com/channel/UCvBLzTQNZnedr4L7JEZ_CdQ
🔴 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

💬 Video transcript
► docs.google.com/document/d/17_JFsXHXGSsq_ggE_yQXELWy7vWw6vURkBx4GX6ckLs/edit?usp=sharing

⏲️ Timestamps:
0:00 Intro
0:15 The SDF formula
2:47 Drawing a line
3:39 Procedural clock face
4:12 Drawing a polyline
4:50 Rainbow SDF visualization
5:16 Wrap up and credits

🎖️ Credits, references and further reading:
• Inigo Quilez: 2D Line Segment SDF - shadertoy.com/view/Wlfyzl
• Inigo Quilez: Deriving the SDF of a Line Segment - youtube.com/watch?v=PMltMdi1Wzg
• Inigo Quilez: 2D SDFs - iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm

Music:
Ouroboros by Kevin MacLeod
Link: incompetech.filmmusic.io/song/4996-ouroboros
License: filmmusic.io/standard-license

#GameDev #IndieDev #Unity
Drawing a Line Segment in the URP Shader Graph with 2D SDFs! ✔️ 2021.1 | Unity Game Dev TutorialHandling Mod Loading Errors! Tactical Lizard Tamer, Unity Game Dev Log [Part 189]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 Tutorial
Ned Makes Games |

Drawing a Line Segment in the URP Shader Graph with 2D SDFs! ✔️ 2021.1 | Unity Game Dev Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER