Exclude layer from post-process with Shader Graph shader

I know it is possible to exclude layers from a post processing pass, as described here:

I’m trying to understand how I would need to set up a custom shader in ShaderGraph to allow for this step.
I’m using an outline shader adapted from Unity’s Open Project which I can apply to the whole scene by adding it the normal way to the Forward Renderer like so:

However, when I try to add the effect the same way as described in the sample, in order to only affect specific layers, it doesn’t work properly:

The outlines are all over the place. So apparently I have to set up the shader for this specific approach. What would I need to adjust? Here is my graph for reference:


I’ve also attached the Outlines.hlsl file for reference on how the shader works.

Thank you for your help.

8122094–1052804–outline.hlsl…txt (3.03 KB)

if you found a solution to your problem, i share the same issue ^^’