If each pixel in the texture is meant to be several pixels on screen you would actually want to add 0.5/(texture_size*pixel coverage). So if you had 4x4 "pixels" then your coverage would be 4.
Okay, I think this is what I was missing. I
think I understand why this makes sense...
I tested this and got even more confused. I started adding (1.0/(128*colfactor*2)) where 128 is the known size of the texture and "colfactor" is the scale factor (1x,2x,3x,4x) of how many "texels" per pixel. When tested at a large scale (unfortunately, I don't have any machines that misbehave, so I can only test by mailing the game to lots of people) it works. However, when I set the scale to 1x (i.e. pixel coverage is one texel = one pixel) I get pixel bleed over:
http://i.imgur.com/XFRh1.pngEven though at that point I'm adding 1/(2*128) to each pixel and that should have me smack dab in the middle of each texel, so I don't understand how this is happening.
One test you might do is to turn on bilinear filtering and take a screenshot. The greyscale will give you an idea of where in the texture you're sampling from. 50% grey will mean you're taking right from the boundary line between two pixels.
I assume you mean at 1x scale (because at 2x scale or with higher-than-1 "pixel coverage" it would naturally be interpolating between points always). I also assume you just mean, turn on _LINEAR instead of NEAREST?
Oddly, adding (0,0) to each texture coord I see things as I expect to see things:
http://i.imgur.com/iPZwP.pngAdding 1/256 I see a mess:
http://i.imgur.com/ggbWO.pngThis is the opposite of what I would expect.
I begin to wonder if Polycode is doing some texture coord adjustment for me, but I can't find any such thing in the source code. The shader uses gl_TextureMatrix but doesn't seem to be setting the texture matrix anywhere.
You can also take your current screenshots and look at the position of the single pixel lines. If you're filling the screen with 4x4 'pixel' text then every character's position should be a multiple of 4 * character height. It looks like your characters are 8x8 so that means each line should start at a multiple of 32. If one of those lines is at 479 instead of 480 that would mean your math for calculating your character positions was off.
You mean, assuming that the texture starts at pixel 0,0 right? Hm.
It would be nice to understand what is happening here but I am currently leaning toward the pixel doubling solution as it is the one thing guaranteed to in all circumstances work. :/