| <<< Texture coordinates | Index | How is texture image loaded? >>> |
Texture coordinates are supplied as part of the vertex attributes:
// Load the UV coordinates:
glBufferSubData(
GL_ARRAY_BUFFER,
6*NUM_VERTICES*sizeof(GLfloat),
2*NUM_VERTICES*sizeof(GLfloat), UVs );
Texture coordinates are typically normalized, put in range [0,1]
UV coordinates are also known as texel coordinates, or coordinates of the pixels within the texture image.
Thus, a coordinate of 0.5 will always be in the middle of the texture image, regardless of the image size
| <<< Texture coordinates | Index | How is texture image loaded? >>> |