Unity SpriteAtlas and outline shader (Amplify)

I just start to study shaders, and AmplifyShader Editor, and don’t know some basics in both, so may be there are simple solution, but I don’t know where is some checkbox…

I have outline shader, which is works on common principle: offset texture up-down-lef-right, add to main texture - and it’s done. Shader works perfectly, it can coloring, thickness, all that you need.
It works with spriteRenderers.
But I use Unity SpriteAtlases in project, its created automatically (so it is not prepared texture sheet), sprites in atlas has different sizes etc. I can’t remove atlases by list of reasons, so…
When atlas is builded (in runtime), shader starts to work with all atlas texture instead of single sprite. And there is a list of problems.

  1. Outline thickness calculates from atlas size, not single sprite. It is percents, so thick outline on single sprite converts to booold outline.
    image
  2. If atlas is not square (and I have such atlases), outline is not steady (uniform?..) It has different thickness on with and height.
    image
  3. And most important. Sprite in atlas is surrounded other sprites, and wher shader do its offsets, other ofsetted sprites is drawed on target sprite. I added some free space on target sprite, I setted padding in atlases on maximum - it doesn’t help.

First I tried to dig “how to render only part of all atlas texture”, but then I thought - SpriteRenderer already rendering part of texture. So I think in is not right direction. Though I can horribly mistake. (And I can get part of textture, I founded solution, and I will can develop this idea further if need).
Then I think about nodes in shader editor. I thought - may be I can manipulate offset of only part of texture? Such as: apply offset to some sample of texture (which looks like single sprite); cast this part somehow???
Or apply offset to UV, not texture; but in ASE offset node input takes only texture for offset. (Shader graph offset node, through, takes UV).
image
I’m stucked, and can’t understand basic principles; may be it is easy (though I think I would founded this in google, if it was simple…).
I need help with understanding in first place. Thank all who can clear this things

I continue great tradition to anser on my questions by myself (if someone will google it).
I make outline to work with unity atlases.
First, I discover error in shader. It offsets picture by picture’s size in percents, so if I had rectangle sprite (not square), outline thickness was different on width and height. And I founded calculations based on TexelSize; so input thickness (which is 1 digit) used for calculating outline widht separatly and height separatly.
SUDDENLY it fixed atlas problem. Sorry, my knowledge still sucks, so I can’t explait, why.

One problem still remained: atlas variants. We use MasterAtlas and AtlasVariants with 0.5 scale for weak devices. Outline was too thick with 0.5 scaled atlas. So I added property for calculating thickness; if atlas variant is loaded, script sends float=0.5 for this property. And thickness multiply on this scale. And all looks great.

Summary
    [SerializeField] private SpriteRenderer _sprite;
    private readonly int _atlasScale = Shader.PropertyToID("_atlasScale");

    private IEnumerator Start()
    {
        //get wrong atlas data without yield
        yield return new WaitForEndOfFrame();
        
        if (Math.Abs(_sprite.sprite.spriteAtlasTextureScale - 1.0f) < 0.00001) yield break;
        
        var material = _sprite.material;
        if (!string.Equals(material.shader.name, "Custom/Sprite/SpriteOutline") &&
            !string.Equals(material.shader.name, "Custom/Sprite/SpriteUniversal"))
        {
            Debug.LogException(new Exception(string.Format(
                "Wrong shader on object \"{0}\", cant apply property", 
                _sprite.name)));
            yield break;
        }
    
        material.SetFloat(_atlasScale, 0.5f);

So it causes material instances for sprites… But it is acceptable by now. I tries to use MaterialPropertyBlock, but it broked all - it is future problem =)

old thickness:

new thickness calculating (with local variables):