my question regards how a texturecoordinate exactly maps to texel in a texture (not taking into consideration filtering).
does (0,0) for example refere to the top left corner of the top left pixel or does it refere to the center of the top left pixel?
if using near-filtering, what pixel is fetched at the texture coordinate (0.5,0.5)?
what about (1.0,1.0), does it refere to the bottom-right corner of the bottom-right pixel or rather the top-left corner of the bottom-right pixel? (i can recall that some years ago this differed between some ATI and NVIDIA cards. is it now standardized?)
if using texelFetch() instead of textureLod(), what's the correct way to access the pixel?
is it
ivec2 size = textureSize(sampler,0);
ivec2 iCoords = ivec2(int(uv.x*size.x),int(uv.y*size.y));
vec4 col = texelFetch(sampler,iCoords);
or is maybe
ivec2 iCoords = ivec2(int(uv.x*size.x+0.5f),int(uv.y*size.y+0.5f));
correct?
or even
ivec2 iCoords = ivec2(int(uv.x*(size.x+1)),int(uv.y*(size.y+1)));
?
maybe someone can clarify how the mapping exactly works?