Texture

Edit

Textures are multidimensional blocks of memory on the GPU, contrasted with Buffer objects which are one-dimensional. Textures are used as the destination for rendering operations, and textures loaded from images provide surface data to Material objects.

Constructors

lovr.graphics.newTextureCreate a new Texture.
lovr.graphics.newTextureViewCreate a texture view.

Metadata

Texture:getDimensionsGet the dimensions of the Texture.
Texture:getFormatGet the format of the Texture.
Texture:getHeightGet the height of the Texture, in pixels.
Texture:getLabelGet the debug label of the Texture.
Texture:getLayerCountGet the layer count of the Texture.
Texture:getMipmapCountGet the number of mipmap levels in the Texture.
Texture:getSampleCountGet the number of MSAA samples in the Texture.
Texture:getTypeGet the type of the Texture.
Texture:getWidthGet the width of the Texture, in pixels.
Texture:hasUsageCheck if a Texture was created with a set of usage flags.

Transfers

Texture:clearClear the Texture to a color.
Texture:generateMipmapsRegenerate mipmaps for a Texture.
Texture:getPixelsGet the pixels of the Texture.
Texture:newReadbackRead back the contents of the Texture asynchronously.
Texture:setPixelsReplace pixels in the Texture.

Sampler

Texture:getSamplerGet the Sampler assigned to the Texture.
Texture:setSamplerSet sampler settings for the Texture.

See also