Hello,
I wrote an outline shader for urp 11.0, with the help of this awesome blog post : The Quest for Very Wide Outlines. An Exploration of GPU Silhouette… | by Ben Golus | Medium
Here is my test scene for the blur and outline shader in urp 11:
This is the exact same scene in urp 12 and 13:
Without entering into detail, the stencil buffer is used to hide the inside of an outline object. So, in this screenshot stencil buffer seams broken (not used).
I also tested to add a CustomRenderObjects that writes to the stencil buffer to completely hide the shader, but this also didn’t work.
By looking to the frame debugger, I saw that now the shader pass write the stencil buffer inside _CameraColorAttachment, instead of the classic _CameraColorTexture like before.
With further re-search, I found that unity is now using two render textures instead of one (_CameraColorAttachment and _CameraDepthAttachment).
That raise some questions:
Should I use _CameraDepthAttachment render texture as stencil buffer texture now?
What is the correct way to use _CameraColorAttachment and _CameraDepthAttachment in a ScriptableRenderPass?
Is there a third texture for the stencil buffer, since urp 12.0?
Edit: The pass is configured like this:
ColorMask 0
Cull Back
ZWrite On
ZTest Greater
Stencil {
Ref 1
Comp Always
Pass Keep
ZFail Replace
}
The pass is invoked like this from a scriptablerender pass
cmd.DrawRenderer(rs.Renderer, outlineMat, j, interiorStencil);




