I’m new to URP, so I checked a URP outline effect for my game:
Outline.shader
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more
// by @gravitonpunch for ECS/DOTS/HybridRenderer.
// https://twitter.com/bgolus
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
Shader "Hidden/Outline"
{
Properties
This file has been truncated. show original
OutlineFeature.cs
// Modified version of outline renderer feature by Alexander Ameye.
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class OutlineFeature : ScriptableRendererFeature
This file has been truncated. show original
OutlinePass.cs
// Modified version of outline render pass by Alexander Ameye.
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
This file has been truncated. show original
There are more than three files. show original
which gives this result:
I was able to convert multiple effects from the old format to URP, so I’m trying to make an outline, from what I checked in the Frame Debugger, the stencil buffer detects the full object in render, so I’m trying to see if it can detect the alpha of an object and the render only visible parts:
Any help will be welcome.
Okay after working some things out on the I fixed the Stencil buffer, but the outline is still giving me problems