self:has_mipmaps

Client

Checks whether the texture has a generated mipmap chain


Syntax

local result = self:has_mipmaps()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if the texture has a mipmap chain, false otherwise

Examples

Check before applying a mipmap-based filter
local entity = core.texture.create("assets/diffuse.png")

if entity:has_mipmaps() then
    entity:set_filter(core.texture.texture_filter.LINEAR_MIPMAP_ANISOTROPIC)
end
Guard a compress call that requires mipmaps
local entity = core.texture.create("assets/terrain/cliff_diffuse.png")

if entity:has_mipmaps() then
    entity:set_filter(core.texture.texture_filter.LINEAR_MIPMAP)
    entity:compress(core.texture.compression_mode.BPTC)
end

On this page