Unity screen-space outlines for the Universal Render Pipeline (URP) using a lightweight Scriptable Renderer Feature and Render Graph pass.
If you are searching for terms like "Unity URP outline shader", "screen space outlines Unity", or "URP edge detection shader", this repository is a minimal, production-friendly starting point.
This repo is the free/minimal variant of Atan Outline Pro. Full version: https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/atan-outline-urp-321755
- ✅ Screen-space outlines in URP (post-style edge effect).
- ✅ Built with Render Graph (
RecordRenderGraph) for modern URP pipelines. - ✅ Uses camera normal texture for clean geometric edge detection.
- ✅ Roberts cross filter style normal-based edge detection in shader.
- ✅ Exposed controls:
Normal ThresholdOutline SizeOutline Color(with alpha blending)
- ✅ Lightweight implementation with a small C# + shader footprint.
- A custom
ScriptableRendererFeature(OutlineFeatureLite) adds a render pass. - The pass requests Color + Normal inputs.
- The shader samples
_CameraNormalsTextureand_CameraOpaqueTexture. - It computes normal discontinuity (edge strength) and blends
OutlineColorover the camera color.
This provides a stylized toon/cartoon-like outline effect without per-object outline meshes.
- Unity: intended for recent Unity versions that support URP Render Graph path.
- Pipeline: Universal Render Pipeline (URP).
- Injection point:
BeforeRenderingTransparents. - Camera type: Game camera.
- Copy the
AtanOutlineLitefolder into your Unity project (for example underAssets/). - Ensure URP is set up in your project.
Add this repository and reference the folder contents in your project workflow.
- Open your URP Renderer asset (Forward Renderer/Universal Renderer).
- Add
OutlineFeatureLiteto the renderer features list. - Assign the included
OutlineMaterialLite(or create a material withAtanOutlineLite/OutlineShader). - Tune:
- Normal Threshold (higher = fewer edges)
- Outline Size (pixel-radius sampling amount)
- Outline Color (alpha controls blend strength)
AtanOutlineLite/Scripts/OutlineFeatureLite.cs- Registers the pass and configures required inputs.
AtanOutlineLite/Scripts/OutlinePass.cs- Pushes runtime parameters to material and performs blit in Render Graph.
AtanOutlineLite/Scripts/OutlineSettings.cs- Serializable settings for threshold, size, and color.
AtanOutlineLite/Shaders/OutlineShader.shader- Full-screen outline shader using normal-based edge detection.
- This is a full-screen pass, so cost scales with resolution.
- Larger outline sizes increase sampling distance and visual thickness.
- Best results come from balancing threshold and size for your scene style.
- Toon/cel-shaded games
- Object readability in complex scenes
- Stylized rendering pipelines
- Prototype-friendly NPR effects
See LICENSE.
