I made a simple shader in shadergraph. I’m simply combining a main-Texture with a seperate alpha-texture.
If i use that shader on a regular unsliced sprite image (left), everything looks as expected.
But i actually want to use it on the single slices of a sliced image. (like it can be seen on the right).
For an alpha-texture to fit a single slice, i can use the Tiling-and-Offset-Node.
But how can i calculate the correct values for this node inside shadergraph, so every alpha-texture fits the sliced image?
Okay, figured it out.
I just set the wrap mode of the alpha-texture to repeat and set the tiling to the amount of rows and colums of the sliced image.
Now everything works as i want.