Absolute texture coordinates are in the range [0.0, width] x [0.0, height].
Normalized texture coordinates (i.e. UV) are in the range [0.0, 1.0] x [0.0, 1.0].
The corresponding absolute texture coordinates of a texel are of the form: (x + 0.5, y + 0.5) with x in [0, width - 1] and y in [0, height - 1].
The top-left texel has absolute texture coordinates (0.5, 0.5).
The bottom-right texel has absolute texture coordinates (width - 1.0 + 0.5, height - 1.0 + 0.5) = (width - 0.5, height - 0.5).
The corresponding normalized texture coordinates of a texel are of the form: ((x + 0.5) / width, (y + 0.5) / height) with x in [0, width - 1] and y in [0, height - 1].
The top-left texel has absolute texture coordinates (0.5 / width, 0.5 / height).
The bottom-right texel has absolute texture coordinates ((width - 1.0 + 0.5) / width, (height - 1.0 + 0.5) / height) = (1.0 - 0.5/width, 1.0 - 0.5/height).
Therefore, normalization factors should be equal to (1/width, 1/height) instead of (1/(width - 0.5), 1/(height - 0.5)) or (1/(width - 1), 1/(height - 1)).
Absolute texture coordinates are in the range
[0.0, width] x [0.0, height]
. Normalized texture coordinates (i.e. UV) are in the range[0.0, 1.0] x [0.0, 1.0]
.The corresponding absolute texture coordinates of a texel are of the form:
(x + 0.5, y + 0.5)
withx
in[0, width - 1]
andy
in[0, height - 1]
. The top-left texel has absolute texture coordinates(0.5, 0.5)
. The bottom-right texel has absolute texture coordinates(width - 1.0 + 0.5, height - 1.0 + 0.5)
=(width - 0.5, height - 0.5)
.The corresponding normalized texture coordinates of a texel are of the form:
((x + 0.5) / width, (y + 0.5) / height)
withx
in[0, width - 1]
andy
in[0, height - 1]
. The top-left texel has absolute texture coordinates(0.5 / width, 0.5 / height)
. The bottom-right texel has absolute texture coordinates((width - 1.0 + 0.5) / width, (height - 1.0 + 0.5) / height)
=(1.0 - 0.5/width, 1.0 - 0.5/height)
.Therefore, normalization factors should be equal to
(1/width, 1/height)
instead of(1/(width - 0.5), 1/(height - 0.5))
or(1/(width - 1), 1/(height - 1))
.