Let There Be Light (And Shadow) | Writing Unity URP Code Shaders Tutorial [2/9] ✔️ 2021.3
14.2 هزار بار بازدید -
2 سال پیش
-
✔️ Tutorial tested in 2020.3
✔️ Tutorial tested in 2020.3 and 2021.3
Have you ever wondered how lighting and shadows work in Unity? Or, do you want to write your own shaders for the Universal Render Pipeline, but without Shader Graph? Either because you need some special feature or just prefer writing code, this tutorial has you covered.
In fact, this is the second part in a series about writing HLSL shaders for URP. In this video, I will show how to add lighting to a shader. This includes a simple explanation of shadow mapping - how objects cast and receive shadows in URP - as well as an introduction to keywords and shader variants - an important concept when writing shaders!
Tutorial series:
📰 Article version ►Medium: 112d370c2b75
🔀 Playlist ► Writing URP Code Shaders Series
1️⃣ The Graphics Pipeline ► The Graphics Pipeline and You | Writi...
2️⃣ Lighting and Shadows ► You're watching it!
3️⃣ Transparency ► Transparent and Crystal Clear | Writi...
4️⃣ PBR Materials ► Mapping Our Way to PBR | Writing Unit...
5️⃣ Advanced Lighting ► Coming soon
6️⃣ Advanced URP Features ► Coming soon
7️⃣ Custom Lighting Models ► Coming soon
8️⃣ Vertex Animation ► Coming soon
9️⃣ Interacting with C# ► Coming soon
👑 Join my Patreon to access tutorials early, download project files, vote on future topics, and more! Thank you so much!
► Patreon: nedmakesgames
🔗 Check out my website for a searchable list of tutorials!
► https://nedmakesgames.github.io
2️⃣ 2nd Channel ► nedmakesgames2
🔴 Twitch ► Twitch: nedmakesgames
🐦 Twitter ► Twitter: nedmakesgames
🎮 Discord ► https://discordapp.com/invite/ubxSVBK
📸 Instagram ► Instagram: nedmakesgames
👽 Reddit ► Reddit: nedmakesgames
🎶 TikTok ► TikTok: nedmakesgames
☕ Ko-fi ► https://ko-fi.com/nedmakesgames
📚 Reference scripts
► https://gist.github.com/NedMakesGames...
⏲️ Timestamps:
0:00 Intro
1:10 Blinn-Phong
2:53 Hash-if statements
4:56 Albedo
5:20 Normals
8:26 Specular highlights
9:52 Keywords
10:43 Smoothness
11:45 Shadow mapping
13:58 Shadowcoords
14:30 Multi compiles
15:58 Cascades and soft shadows
18:17 The frame debugger
19:32 The shadow caster pass
21:35 The depth buffer
22:37 Shadow acne
25:12 ColorMask
25:40 Wrap up and credits
🎖️ Credits, references and further reading:
• Unity Technologies: Shader Calibration Scene - https://assetstore.unity.com/packages...
• Martijn Vaes: DAE — Bilora Bella 46 Camera — Game Ready Asset - https://sketchfab.com/3d-models/dae-b...
• tonyflanagan: Thailand Girl — Animated - https://sketchfab.com/3d-models/thail...
• Aleksei Vlasov ⚡ CRWDE: Phonograph - https://sketchfab.com/3d-models/phono...
• gugusheep: VR Showroom Gallery for product placement - https://sketchfab.com/3d-models/vr-sh...
• Andreas Mischok: Drackenstein Quarry - https://polyhaven.com/a/drackenstein_...
Music provided by Epidemic Sound
#GameDev #IndieDev #Unity
Have you ever wondered how lighting and shadows work in Unity? Or, do you want to write your own shaders for the Universal Render Pipeline, but without Shader Graph? Either because you need some special feature or just prefer writing code, this tutorial has you covered.
In fact, this is the second part in a series about writing HLSL shaders for URP. In this video, I will show how to add lighting to a shader. This includes a simple explanation of shadow mapping - how objects cast and receive shadows in URP - as well as an introduction to keywords and shader variants - an important concept when writing shaders!
Tutorial series:
📰 Article version ►Medium: 112d370c2b75
🔀 Playlist ► Writing URP Code Shaders Series
1️⃣ The Graphics Pipeline ► The Graphics Pipeline and You | Writi...
2️⃣ Lighting and Shadows ► You're watching it!
3️⃣ Transparency ► Transparent and Crystal Clear | Writi...
4️⃣ PBR Materials ► Mapping Our Way to PBR | Writing Unit...
5️⃣ Advanced Lighting ► Coming soon
6️⃣ Advanced URP Features ► Coming soon
7️⃣ Custom Lighting Models ► Coming soon
8️⃣ Vertex Animation ► Coming soon
9️⃣ Interacting with C# ► Coming soon
👑 Join my Patreon to access tutorials early, download project files, vote on future topics, and more! Thank you so much!
► Patreon: nedmakesgames
🔗 Check out my website for a searchable list of tutorials!
► https://nedmakesgames.github.io
2️⃣ 2nd Channel ► nedmakesgames2
🔴 Twitch ► Twitch: nedmakesgames
🐦 Twitter ► Twitter: nedmakesgames
🎮 Discord ► https://discordapp.com/invite/ubxSVBK
📸 Instagram ► Instagram: nedmakesgames
👽 Reddit ► Reddit: nedmakesgames
🎶 TikTok ► TikTok: nedmakesgames
☕ Ko-fi ► https://ko-fi.com/nedmakesgames
📚 Reference scripts
► https://gist.github.com/NedMakesGames...
⏲️ Timestamps:
0:00 Intro
1:10 Blinn-Phong
2:53 Hash-if statements
4:56 Albedo
5:20 Normals
8:26 Specular highlights
9:52 Keywords
10:43 Smoothness
11:45 Shadow mapping
13:58 Shadowcoords
14:30 Multi compiles
15:58 Cascades and soft shadows
18:17 The frame debugger
19:32 The shadow caster pass
21:35 The depth buffer
22:37 Shadow acne
25:12 ColorMask
25:40 Wrap up and credits
🎖️ Credits, references and further reading:
• Unity Technologies: Shader Calibration Scene - https://assetstore.unity.com/packages...
• Martijn Vaes: DAE — Bilora Bella 46 Camera — Game Ready Asset - https://sketchfab.com/3d-models/dae-b...
• tonyflanagan: Thailand Girl — Animated - https://sketchfab.com/3d-models/thail...
• Aleksei Vlasov ⚡ CRWDE: Phonograph - https://sketchfab.com/3d-models/phono...
• gugusheep: VR Showroom Gallery for product placement - https://sketchfab.com/3d-models/vr-sh...
• Andreas Mischok: Drackenstein Quarry - https://polyhaven.com/a/drackenstein_...
Music provided by Epidemic Sound
#GameDev #IndieDev #Unity
2 سال پیش
در تاریخ 1401/05/24 منتشر شده
است.
14,273
بـار بازدید شده