Sprite Diffuse Shader

In Unity there are multiple ways to create a "Sprite Diffuse Shader" (meaning that sprites are affected by light sources), using both Shader Graph (URP) or HLSL.
Using Shader Graph
URP/SRP
With the addition of the URP (Universal Render Pipeline), or SRP (Scriptable Render Pipeline) you can use the "2D" rendering asset, which already includes a Sprite Diffuse Shader.
LWRP/HDRP
If you're using older versions of Unity, with LWRP or HDRP installed, here's how you can create a Sprite Diffuse Shader. In this tutorial I've used: Lightweight Render Pipeline 2.0.5-preview, Unity 2018.2.0f2.
Here's what we'll achieve:
Diffuse Shader
Here's the shader:

Explanation
In a few words: Sprite Renders need the sprites texture to be called "_MainText".
HLSL
If you want to write a sprite diffuse shader in HLSL, you can go to the Unity Archive and install the built-in shaders for each Unity version.
Thanks for reading! ❤️
Let us know what you think! We're a small team and we are loving what we do, so any feedback is appreciated ❤️ You can also consider joining the newsletter (either weekly or monthly, we care deeply about it) and never miss our new posts. Cheers!
✦ Join the newsletterMore Posts
Creating custom inspectors in Godot C# more easily
Creating custom inspectors in Godot can become a bit tedious in C#, so we have built a custom and free addon that handles this for you!
LinkedIn will use your data to train thier AI
Starting November 3rd, 2025, LinkedIn will start using your data to train their AI. Ughh.
The Best Gamescom so far! August 2025
We just attended Gamescom (and devcom) this year and they were the best one for us so far!! Here's a short update about the general mood and more thoughts.
How to dynamically scale font size in Godot
We wrote a custom script to scale font sizes dynamically in Godot, so that we can make a better and responsive UI for different resolutions. Read More!
I'm giving a talk at devcom 2025!
I am giving a talk at devcom 2025 about the many lessons I have learned while developing and selling Text Animator for Unity! I'll also make a post here in the future... read more!
A good week for Godot! August 2025
From Battlefield 6 to GMTK's Game Jam, it was a good week for Godot!
Comments