I'm fairly new to programming and this is the first time I've ever messed with Unity shaders. I have a texture composed of differently shaped pixel blobs, each of which has a unique color. (Sort of like the way Paradox games do map generation.) I want to be able to mouse over a blob and have it highlighted on the map, and I wrote a shader which does this using a color mask.
However, I now need to find a way to send it the mouse data. I have a function which converts the location of the mouse in world space to its location in the 512x373 texture I'm using, divides it by 1000, and sends that input to the UV input of a SampleTexture2D node in shadergraph. There's clearly some relationship between the coordinates I'm giving it and the correct UV coordinates, but I'm not sure what it is. When I move my mouse left, the selected area moves left, for example, but the selected area is not the one actually directly under my mouse.
How do UV coordinates correspond to coordinates within a texture? Is there an offset I need to use?