Material:setTransform

Sets the transformation applied to texture coordinates of the Material. This lets you offset, scale, or rotate textures as they are applied to geometry.

Material:setTransform(ox, oy, sx, sy, angle)

Arguments

NameTypeDescription
oxnumberThe texture coordinate x offset.
oynumberThe texture coordinate y offset.
sxnumberThe texture coordinate x scale.
synumberThe texture coordinate y scale.
anglenumberThe texture coordinate rotation, in radians.

Returns

Nothing

Notes

Although texture coordinates will automatically be transformed by the Material's transform, the material transform is exposed as the mat3 lovrMaterialTransform uniform variable in shaders, allowing it to be used for other purposes.

See also