Texture
EditTextures 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.newTexture | Create a new Texture. |
lovr.graphics.newTextureView | Create a texture view. |
Metadata
Texture:getDimensions | Get the dimensions of the Texture. |
Texture:getFormat | Get the format of the Texture. |
Texture:getHeight | Get the height of the Texture, in pixels. |
Texture:getLabel | Get the debug label of the Texture. |
Texture:getLayerCount | Get the layer count of the Texture. |
Texture:getMipmapCount | Get the number of mipmap levels in the Texture. |
Texture:getSampleCount | Get the number of MSAA samples in the Texture. |
Texture:getType | Get the type of the Texture. |
Texture:getWidth | Get the width of the Texture, in pixels. |
Texture:hasUsage | Check if a Texture was created with a set of usage flags. |
Transfers
Texture:clear | Clear the Texture to a color. |
Texture:generateMipmaps | Regenerate mipmaps for a Texture. |
Texture:getPixels | Get the pixels of the Texture. |
Texture:newReadback | Read back the contents of the Texture asynchronously. |
Texture:setPixels | Replace pixels in the Texture. |
Sampler
Texture:getSampler | Get the Sampler assigned to the Texture. |
Texture:setSampler | Set sampler settings for the Texture. |