Unity Shader Graph Tutorial for Beginners
You will learn what a shader is in plain terms, then build one lit material in Shader Graph with a color, a smoothness control that varies across the surface, and a glowing rim you can see move as the camera turns.
Shader Graph can look like a wall of boxes and wires the first time you open it. You do not need to understand all of it. You need one material that works, so the rest starts to make sense.
This guide assumes you use the Universal Render Pipeline, often called URP. Shader Graph menus and template names shift between Unity versions and pipelines. If a menu path below does not match your editor, check the official Shader Graph and URP documentation for your exact version.
What a shader is, in plain language
Every frame, your graphics card draws each object on screen pixel by pixel. For each pixel, it has to answer one question: what color should this be?
A shader is the small program that answers that question. It looks at the surface, the lights, and the camera, then returns a color. A material is a shader plus the values you feed it, like “this red” or “this shiny.”
Shader Graph lets you build that program by connecting nodes instead of writing code. Each node does one small job. One gives you a color. Another measures the angle to the camera. Another blends two values. Wires carry numbers from one node to the next, and the final values land on the surface.
That is all. The rest is learning which small jobs to chain together.
Create the graph
In the Project window, use the create menu to make a new Shader Graph. Under URP, pick the Lit option. Name it something clear, like SG_RimSurface.
Right-click the new graph and create a material from it. Drag that material onto a sphere in your scene. A sphere is the best test object, because it shows every angle at once.
Open the graph. You see two stacks of outputs, called contexts. The vertex context controls the shape. The fragment context controls the color of each pixel. In the URP Lit graph, the fragment context includes Base Color, Smoothness, and Emission. You will use those three.
Step one: a color you can change
Open the Blackboard, the panel that lists your graph’s properties. Add a Color property and name it Base Tint. Drag it onto the graph and connect it to Base Color.
Save the graph. Select your material in the Inspector. You now have a color picker. Change it and watch the sphere update.
Exposed properties like this are the main way you will tune materials later. Any value you might want to tweak per material belongs in the Blackboard.
Step two: smoothness, and why it is not roughness
Many tools describe shine as roughness. URP’s Lit graph uses smoothness instead. They are opposites. High smoothness gives a tight, sharp highlight. Low smoothness spreads the highlight out until the surface looks matte.
If you bring a roughness texture from another tool, you will need to invert it. A One Minus node does that.
Start simple. Add a Float property named Smoothness, set it as a slider from zero to one, and connect it to the Smoothness output. Save and drag the slider. Watch the highlight on the sphere tighten and spread.
Now make it change across the surface. Real surfaces are rarely even. A floor is wet in one corner and dusty in another.
- Add two Float properties: Dry Smoothness and Wet Smoothness.
- Add a Simple Noise node. It outputs a soft gray pattern.
- Add a Lerp node. Plug Dry Smoothness into A, Wet Smoothness into B, and the noise into T.
- Connect the Lerp output to Smoothness, replacing the single slider.
Lerp means “blend between A and B by T.” Where the noise is dark, you get the dry value. Where it is light, you get the wet value.
Add a Float property for the noise scale and connect it to the noise node’s scale input. Larger values give smaller patches. Tune it until the patches look like puddles instead of static.
Step three: a fresnel rim you can see
Fresnel describes how surfaces reflect more light at grazing angles. Look straight at a window and you see through it. Look along it and it turns into a mirror. Games use this idea for a rim glow around the edge of an object.
The Unity docs describe the Fresnel Effect node as returning a value from zero to one. It is low where the surface faces the camera and high where the surface turns away at the edges.
Build the rim:
- Add a Fresnel Effect node.
- Add a Float property named Rim Power and connect it to the node’s Power input. Higher power pushes the glow tighter to the edge.
- Add a Color property named Rim Color. Set it to HDR in the property settings if you want it to bloom with post-processing.
- Add a Multiply node. Multiply the fresnel output by Rim Color.
- Connect the result to Emission.
Save. Orbit the camera around the sphere. The edge glows while the center stays your base tint. Turn Rim Power up and down until the rim looks deliberate, not muddy.
Emission adds light on top of the lit surface. It does not replace your color. That is why the center of the sphere still shows Base Tint and the smoothness pattern.
Optional: make the rim pulse
If you want motion, add a Time node. Take its sine output, which swings between negative one and one. Use a Remap node to move that range to something like a low and a high brightness you choose. Multiply the rim result by it before it reaches Emission.
Now the rim breathes. Keep this subtle. A slow pulse on a pickup reads well. A fast flicker on every object tires the eye.
Test it on a real object
A sphere tells you the material works. A real asset tells you whether it looks right. Put the material on a prop from your game, like a crystal, a door, or an enemy.
Check these things:
- Lighting: rotate your main light. The smoothness patches should catch the highlight differently.
- Distance: view it from your gameplay camera. Some detail that looks nice close up turns to noise at a distance.
- Other materials: place it next to your standard materials. Does it fit the art style, or does it shout?
If the noise looks stretched on your prop, the model’s UVs are likely the cause. Fix the UVs first instead of fighting the shader.
Common beginner mistakes
Forgetting to save the graph. The material does not update until you save. If nothing changes, check that first.
Hard-coding values. If you type a number straight into a node, every material using that graph gets it. Put tunable values in the Blackboard.
Plugging color into smoothness. Smoothness expects a single number. If you connect a color, Unity may only use one channel. Use a Split node or a grayscale value on purpose.
Too much glow. Emission is easy to overdo. Start dim and raise it.
Where to go next
You now know the core loop: add a property, process it with a few nodes, and send it to an output. Every Shader Graph material follows that loop.
Try one change at a time from here. Swap the Simple Noise for a texture you painted. Scroll the noise using Time and a Tiling And Offset node for a flowing look. Or drive the rim color from a script when an enemy takes damage.
Keep each graph small and named clearly. When you come back to it in three months, you will thank yourself.