Hi everyone,
I’ve made a post processing effect for Unity 6, URP only, that add subtle outline effect to the scene. The effect was built upon Unity’s new Render Graph API for optimal performance which (I think) will soon be a standard in writing custom rendering code for URP in the future.
High quality video: https://youtu.be/g1iOwJY3DjE
The edge detection is based on Sobel filter, with some modification & post enhancement so it fit better with game graphics. You can specify the input for it, using scene color, scene depth and normal vectors.
The setup is super simple:
- Add a renderer feature to your URP renderer data asset.
- Add an override to your volume.
- Tuning it to match your style.
Many things you can customize:
- Select the input sources for edge detection: scene color and/or depth and/or normal.
- Select the target for edge detection: Opaque, Opaque-Transparent, Opaque-Transparent-PostProcessing
- Blend edges with scene color or draw edges only.
- Fast mode for Mobile & low end devices.
- Noise/artifacts reduction.
- Edge highlight & enhancement options.
- Fade by distance.
- Custom edge coloring, HDR edge color supported.
- Changing edge & scene color blend mode.
Multi-platforms
Tested on PC, Mobile and WebGL, at stable and high framerate.
Some screenshots
Some resources to take deeper look if you’re interested
Tutorials | Documentation
Additional detail
This asset only work with Unity 6 and up, Universal Render Pipeline, fully compatible with the new Render Graph API for optimal performance.
The fullscreen shader was created in Shader Graph for ease of customization, with some functions provided as HLSL code in Custom Function nodes.
Works great with FXAA, SMAA, TAA.
Number of shader: 1
Number of Scriptable Render Pass each frame: 1
Asset Store link: https://u3d.as/3qqp
Note: Link not work yet. It will be release in mid December.