Your comments

For the case of bridging far away nodes, I'd actually like to see something like "remote" relays, or basically set and get variable nodes. That way you could output from a node to a setVariable node (with a name), and anywhere else in your graph you can drop a getVariable node which lets you choose from a source list of all setVariables you have added. You can add many gets for one set. Example mockup:





Grabbed 1.18, and I see the stencil options, but I'm not sure how to get it to work with the Unity UI. The UI still complains about the shader missing stencil properties, etc.
Hooray! I just grabbed that from the source of the stock UI Default shader, if you want to use that as reference.
If I add these changes to a shader produced by Shader Forge, the shader will work with UI masking. Unfortunately these get cleared out whenever editing the shader:

Properties    {
        ...

        _StencilComp ("Stencil Comparison", Float) = 8
        _Stencil ("Stencil ID", Float) = 0
        _StencilOp ("Stencil Operation", Float) = 0
        _StencilWriteMask ("Stencil Write Mask", Float) = 255
        _StencilReadMask ("Stencil Read Mask", Float) = 255

        ...
}

SubShader    {
        ...
        
        Stencil
        {
            Ref [_Stencil]
            Comp [_StencilComp]
            Pass [_StencilOp] 
            ReadMask [_StencilReadMask]
            WriteMask [_StencilWriteMask]
        }
        
        ...
}

Actually I just discovered that this pixel offset for Direct3D 11 is the same as OpenGL, so both of those are sharp. However if I adjust for non-OpenGL (as in the example here), then one of the Direct3D's (9 or 11) will be blurry. I can maybe check for each version of Direct3D, but do you think this subpixel offset can be built into shader forge?
It looks like Unity has posted a roadmap, and I noticed this as the last feature planned to make it into 5.2:

  • 2D rectangle mask clipping that does not use stencil buffer.
So it looks like maybe the way masking works in the UI will change to not require the stencil buffer, and then maybe a shader forge sprite shader will work with masking in the UI? Hopefully!
I tried using the generated shader forge sprite shader (I called it Uber Shader here), and adding it to a game object with an Image and Mask component, and I get the following errors:



Would there be a way to replicate the built in UI Sprite? This would support the UI sorting / z ordering, as well as UI masking, etc.