Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I sadly don't know of any good references. You might be able to do this using the texture coordinate derivatives. Build two base vectors for the triangle's plane, one in increasing U direction, one in increasing V direction. You can then use these vectors to build a 2D grid that you can step through and get the coordinates of every texel.
What do you need this for? There's not necessarily a defined mapping between texture pixels (texels) and 3D coordinates. A single texel may map to zero, one, or an arbitrary number of points in 3D space.
hexagon_distance is a function, you give it the positions of your attacker and defender and it gives you back the distance between them - that is, the number of hexagons on the shortest path between attacker and defender. ("Distance" doesn't always have to be the euclidean distance, it can be defined differently too.) You can then compare the returned distance against the maximum distance, just like you did with point_distance. You will also have to translate the code into whatever programming language you're using because what I wrote is in C++.
What specific pixel format are you using? And what's the resolution of your floating-point texture? What happens if you increase that resolution? How are you computing the contents of the texture?
I don't think you can handle the "triangle smaller than a pixel" case without spending a lot of computation time on them, sadly. What you can do, however, is to post-process the results and also select all triangles that are completely surrounded by visible triangles, for example. Another work-around would be to increase the resolution for this visibility-test rendering pass. A combination of both will probably give the best results.