Getting Started with Shader Graph in Unity URP
March 15, 20251 min readUnityShadersTutorial
Introduction
Shader Graph is Unity's visual shader authoring tool that lets you create shaders without writing code. In this tutorial, we'll build a simple hologram shader from scratch.
Prerequisites
- Unity 2022+ with URP installed
- Basic understanding of materials and rendering
Step 1: Create a New Shader Graph
Right-click in your Project window and select Create → Shader Graph → URP → Lit Shader Graph. Name it "Hologram".
Step 2: Add the Fresnel Effect
The fresnel effect is what gives our hologram that glowing-edge look:
// If you prefer code, here's the equivalent in HLSL: float fresnel = pow(1.0 - saturate(dot(normalWS, viewDirWS)), _FresnelPower);
Step 3: Scanlines
Add scanlines using the object's world position:
float scanline = step(frac(_Time.y * _ScrollSpeed + positionWS.y * _LineFrequency), _LineWidth);
Conclusion
Shader Graph makes it accessible to prototype visual effects quickly. Once you're comfortable, you can always drop into HLSL for performance-critical shaders.