Texture:generateMipmaps

Edit

Regenerates mipmap levels of a texture. This downscales pixels from the texture to progressively smaller sizes and saves them. If the texture is drawn at a smaller scale later, the mipmaps are used, which smooths out the appearance and improves performance.

Texture:generateMipmaps(base, count)

Arguments

NameTypeDefaultDescription
basenumber1 The base mipmap level which will be used to generate subsequent mipmaps.
countnumbernil The number of mipmap levels to generate. If nil, the rest of the mipmaps will be generated.

Returns

Nothing

Notes

Mipmaps will automatically be regenerated for textures after rendering to them in a Pass. This can be disabled by rendering to a single-level texture view instead.

The texture must have been created with the transfer usage to mipmap it.

The texture can not be multisampled.

Texture views can not currently be mipmapped.

See also