Hi.
When you use a fragment shader on a sprite that uses an atlas with multiple images, the value of var_texcoord0 seems to be for the entire atlas, not just the current image on the atlas being used by the sprite. Additionally, when you use a vertex shader on a sprite, position appears to be in world space instead of local space.
I know that one way to get around these limitations is to manually calculate the texcoords for that particular image and hard-code it into the shader (or pass it as a sprite constant), and to constantly pass the world position of the sprite as a sprite constant to subtract from the position variable in the vertex shader. However, these seem to be hacks/workarounds that are far from optimal.
I would like to be able to get the local space and local texcoords for shaders being used on a sprite without having to hard-code values or use sprite constants. As far as I know, shaders in Unity have the ability to pull the object’s world position at will, so I know it’s possible for a feature like this to exist.