Uploaded April 2026 | Updated November 2026, 1 week ago
Lighting is one of the most complex things you'll handle in shaders. The Phong reflectance model splits light into diffuse, specular, and ambient lighting, with Fresnel added as a bonus, and if we want additional realtime point lights, lighting is additive. On top of that, we can use shadow mapping for any number of lights and add a shadow caster pass to allow our own shaders to cast shadows onto objects.
Comparison of render paths: 3dgep.com/forward-plus
------------------------------------------------------------------------
👇 Download the project on GitHub: github.com/daniel-ilett/shaders-hlsl-basics
📰 Read this tutorial in article format instead: danielilett.com/2026-04-17-tut10-06-lighting
------------------------------------------------------------------------
✨ Snapshot Shaders 2 has you covered for all your post processing needs: assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/snapshot-shaders-2-for-urp-331908?aid=1101lfDLn
✨ Grab Retro Shaders Pro, my PSX and N64 shader asset pack, here: assetstore.unity.com/packages/vfx/shaders/retro-shaders-pro-for-urp-287937?aid=1101lfDLn
📚 Get a copy of my shader book here: link.springer.com/book/10.1007/978-1-4842-8652-4
------------------------------------------------------------------------
💬 Join the Discord: discord.gg/tPQEUwPpb3
☕ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
------------------------------------------------------------------------
Lighting is one of the most complex things you'll handle in shaders. The Phong reflectance model splits light into diffuse, specular, and ambient lighting, with Fresnel added as a bonus, and if we want additional realtime point lights, lighting is additive. On top of that, we can use shadow mapping for any number of lights and add a shadow caster pass to allow our own shaders to cast shadows onto objects.
Comparison of render paths: 3dgep.com/forward-plus
------------------------------------------------------------------------
👇 Download the project on GitHub: github.com/daniel-ilett/shaders-hlsl-basics
📰 Read this tutorial in article format instead: danielilett.com/2026-04-17-tut10-06-lighting
------------------------------------------------------------------------
✨ Snapshot Shaders 2 has you covered for all your post processing needs: assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/snapshot-shaders-2-for-urp-331908?aid=1101lfDLn
✨ Grab Retro Shaders Pro, my PSX and N64 shader asset pack, here: assetstore.unity.com/packages/vfx/shaders/retro-shaders-pro-for-urp-287937?aid=1101lfDLn
📚 Get a copy of my shader book here: link.springer.com/book/10.1007/978-1-4842-8652-4
------------------------------------------------------------------------
💬 Join the Discord: discord.gg/tPQEUwPpb3
☕ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
------------------------------------------------------------------------










