MarkerBatchPrimitiveOptionalParametersSetTextureCoordinates Method |
Namespace: AGI.Foundation.Graphics
public void SetTextureCoordinates( IEnumerable<TextureCoordinate4DF> textureCoordinates )
Each texture coordinate component is in the range [0, 1]. The s and t components define the bottom left corner and the p and q components define the upper right corner. When a marker uses an entire texture, the texture coordinates are [s, t, p, q] = [0, 0, 1, 1].
Per-marker texture coordinates are used to implement a technique called a texture atlas. Instead of creating several small textures and assigning each texture to markers using per-marker textures, one large texture containing all the images is made. This texture is assigned to the marker batch and each marker is given texture coordinates that index the correct part of the texture. This can lead to better performance due to the reduced number of costly texture changes during rendering.
Per-marker texture coordinates override the per-batch texture coordinate. Therefore, when per-marker texture coordinates are defined with this method, the marker batch's MarkerBatchPrimitive.TextureCoordinate property is ignored.