Original Post
This is perhaps a pretty basic issue, but I've been getting more and more confused over it lately, and don't seem to be able to find anything that explains it clearly and authoratatively on the net. How should I be finding a certain pixel in a texture in a (vertex) shader? Lets say I have a set of vertices from 0 to 7 (8 vertices), that I want to correspond with one of 8 pixels in a texture. To find the texture coordinates do I do: n / (tot - 1) where n is the number of the vertex (0 to 7), and tot is the total number of vertices (8) - so mapping from 0.0 to 1.0 in steps of 0.142... (treating the pixels as data points spread between 0.0 and 1.0 I suppose). Or do I do something like: n / tot + 0.5 * 1.0 / tot which maps from 0.0625 to 0.9375 in steps of 0.125 (and thus put the vertices in the "middle of the pixels"). The more I write of this the more convinced I am it's the second one, but I'd like someone to confirm it.