Shader Graph lets you build shaders by connecting nodes instead of writing HLSL, and it’s the fastest way to make the effects players notice: things dissolving, glowing edges, scrolling water, holograms, outlines. This Shader Graph tutorial for beginners uses Unity 6 and URP. It covers how a graph works, then builds four practical effects step by step, shows how to drive them from C#, and ends with fixes for the problems everyone hits (pink materials, properties that won’t change, transparency that won’t work).
Shader Graph Basics
Shader Graph comes with URP and HDRP, so there’s nothing extra to install. Create a graph from Assets > Create > Shader Graph > URP:
- Lit Shader Graph: reacts to lights and shadows, like the URP Lit shader. Use it for most 3D objects.
- Unlit Shader Graph: ignores lighting. Cheaper. Good for UI-ish effects, holograms, stylised art and VFX.
- Sprite Lit / Sprite Unlit: for 2D sprites.
Double-click the asset to open the editor. Its main parts:
- Master Stack (right): the outputs. The Vertex block (position, normal) and the Fragment block (Base Color, Normal, Metallic, Smoothness, Emission, Alpha and so on).
- Blackboard: the shader’s properties. Anything here can appear in the material Inspector and be set from C#.
- Graph Inspector: Graph Settings (surface type, alpha clipping, render face) and per-node settings.
- Main Preview: a live preview of the result.
Press Space (or right-click > Create Node) to add nodes, and drag from a port to connect. Remember to click Save Asset in the top-left. Unsaved graphs don’t update your materials.
To use a graph, right-click the graph asset and choose Create > Material, or select an existing material and choose the graph from its Shader dropdown (under Shader Graphs/).
Your First Graph: a Tinted, Textured Material
- Create a Lit Shader Graph called
SG_Tinted. - In the Blackboard, click + > Texture2D and name it
Base Map. Click + > Color and name itTint, default white. - Drag both properties onto the canvas.
- Add a Sample Texture 2D node and connect Base Map to its Texture input.
- Add a Multiply node: RGBA from the sample into A, Tint into B.
- Connect the Multiply output to Base Color. Save.
Select the Base Map property and look at its Reference name in the Graph Inspector (something like _Base_Map). That reference, not the display name, is what you use from code. Rename it to something clean like _BaseMap now so your scripts stay readable.
Effect 1: Scrolling Texture (Water, Conveyors, Lava)
A scrolling texture is just UVs that move over time.
- Add a Vector2 property
Scroll Speed(e.g. 0.1, 0). - Add a Time node and Multiply its Time output by Scroll Speed.
- Add a Tiling And Offset node and connect the Multiply result to Offset.
- Connect Tiling And Offset’s output to the UV input of your Sample Texture 2D.
Set the texture’s Wrap Mode to Repeat in its import settings, or it smears at the edges. For water, sample the same normal map twice with different speeds and directions and add (or blend) the results. The two layers moving against each other look far more natural than one.
Effect 2: Fresnel Rim Glow and Hologram
The Fresnel Effect node outputs values near 1 where a surface faces away from the camera (the silhouette edges) and near 0 where it faces you. That’s the basis for rim lighting, force fields and holograms.
- Add a Fresnel Effect node. Its Power controls how thin the rim is (try 3–5).
- Add an HDR Color property
Rim Color(Color property with Mode set to HDR) and set its intensity above 1. - Multiply Fresnel by Rim Color and connect it to Emission.
For a hologram, switch to an Unlit graph, set Surface Type to Transparent and Blending Mode to Additive in Graph Settings, and feed the Fresnel into Alpha as well. Add scan lines by taking the Position node (World space), splitting out Y, multiplying it by a line count, adding Time, and passing it through a Fraction then a Step node. Multiply that into the alpha.
Emission values above 1 only glow if Bloom is on in a post-processing Volume and Post Processing is ticked on the camera. If nothing glows, see our bloom not working fix.
Effect 3: Dissolve with a Glowing Edge
The classic. A noise pattern decides which pixels disappear first, and a slider controls how far the dissolve has progressed.
- Add a Float property
Dissolvewith Mode set to Slider, range 0–1. Add a FloatNoise Scale(default 30), a FloatEdge Width(0.05) and an HDR ColorEdge Color. - Add a Simple Noise node and connect Noise Scale to its Scale.
- In Graph Settings, tick Alpha Clipping. The Master Stack gets an Alpha Clip Threshold input.
- Connect the noise to Alpha, and the
Dissolveproperty to Alpha Clip Threshold. Pixels whose noise value is below the threshold are discarded. - For the edge: Add Dissolve + Edge Width, then use a Step node with that sum as Edge and the noise as In. One Minus the result and it gives 1 for the thin band just about to dissolve.
- Multiply that band by Edge Color and connect it to Emission.
Drag the Dissolve slider on the material and the object burns away with a glowing rim. Swap Simple Noise for a texture (a cloud or crack pattern) to control the shape of the dissolve.
🧰 Want more than Shader Graph?
For stylised shading, advanced outlines or a node editor with more features, some Asset Store tools save weeks. We compared the ones that are worth the money for indie developers.
Effect 4: Simple Outline
The “inverted hull” outline draws a slightly larger copy of the mesh, showing only its back faces, behind the original.
- Create an Unlit Shader Graph called
SG_Outline. In Graph Settings, set Render Face to Back. - Add a Float
Outline Width(0.02) and a ColorOutline Color. - Add a Position node (Object space) and a Normal Vector node (Object space). Multiply the normal by Outline Width, then Add it to the position.
- Connect the result to the Vertex block’s Position, and Outline Color to Base Color.
- On your object’s Mesh Renderer, add a second material slot and assign the outline material.
Unity warns that the renderer has more materials than submeshes. That’s expected here: the extra material draws the whole mesh again, which is exactly the trick. Hard-edged meshes (like a default cube) show gaps at the corners because their normals split. Smooth-shaded meshes outline cleanly. For screen-space outlines on many objects, a URP Renderer Feature is the better tool.
Controlling Shaders from C#
Use the property’s Reference name, and cache it as an ID:
using System.Collections;
using UnityEngine;
public class DissolveOnDeath : MonoBehaviour
{
static readonly int DissolveId = Shader.PropertyToID("_Dissolve");
[SerializeField] float duration = 1.5f;
Renderer rend;
void Awake() => rend = GetComponent<Renderer>();
public void Die() => StartCoroutine(DissolveRoutine());
IEnumerator DissolveRoutine()
{
// rend.material creates a per-object copy, so other enemies aren't affected
Material mat = rend.material;
for (float t = 0; t < duration; t += Time.deltaTime)
{
mat.SetFloat(DissolveId, t / duration);
yield return null;
}
Destroy(gameObject);
}
}
renderer.materialgives this object its own material instance.renderer.sharedMaterialchanges every object using the material (and the asset itself in the Editor).- For a handful of objects, separate material instances are fine and stay compatible with the URP SRP Batcher. MaterialPropertyBlock avoids creating materials but opts those renderers out of the SRP Batcher, so measure before switching.
Shader.SetGlobalFloatsets a value for every shader that declares that property with Exposed unticked, which is handy for things like a global wind strength.
Troubleshooting
The material is pink
The graph’s target doesn’t match your render pipeline (for example an HDRP graph in a URP project), or the graph has a compile error (the error is shown on the node and in the Console). Check Graph Settings > Active Targets includes Universal. Our pink materials guide covers the other causes.
SetFloat / SetColor does nothing
You’re using the display name instead of the Reference name, the reference has a typo, or you changed a different material instance from the one being rendered. Log mat.HasProperty("_Dissolve") to check.
Transparency doesn’t work
Set Surface Type to Transparent in Graph Settings. Connecting Alpha alone isn’t enough for an Opaque graph. For hard cut-outs (leaves, fences, dissolve), Opaque with Alpha Clipping is cheaper and sorts correctly.
My changes don’t show up in the scene
Click Save Asset. The preview updates live but materials only update after saving.
Emission doesn’t glow
Glow is bloom. Use an HDR colour with intensity above 1, add Bloom to a Volume and enable Post Processing on the camera.
The effect works in the Editor but not in a build
Shader variants may be stripped. If you enable keywords from code, make sure a material in the build uses them, or add the shader to a Shader Variant Collection in Graphics settings.
FAQ
Is Shader Graph good for beginners?
Yes. It’s the easiest way to learn how shaders work, because you see each step’s result in the node previews, and it produces production-quality shaders.
Does Shader Graph work with the Built-in Render Pipeline?
Partially. Recent versions support a Built-in target, but URP and HDRP get the full feature set. Use URP for new projects.
How do I make a dissolve shader in Unity?
Feed a noise node into Alpha, enable Alpha Clipping, and connect a 0–1 Dissolve property to the Alpha Clip Threshold. Add a Step-based edge band to Emission for the glow.
How do I change a Shader Graph property from a script?
Call material.SetFloat, SetColor or SetTexture with the property’s Reference name (for example _Dissolve), ideally cached with Shader.PropertyToID.
Lit or Unlit Shader Graph?
Lit for objects that should react to scene lighting. Unlit for effects, holograms, stylised art and anything that should look the same regardless of lights.
Is Shader Graph slower than hand-written shaders?
Not meaningfully for most effects. It generates normal HLSL. Performance depends on what the graph does, such as how many texture samples and expensive nodes it uses.
Reader questions
Asked by readers of this article and answered by AI. Behavior can differ between Unity versions, so test in yours.




Leave a Reply