gpu_set_tex_mip_enable_ext

With this function you can set whether mipmapping is switched off, switched on for everything or switched on only for texture groups selected in the Texture Group Manager on a shader sampler. You supply the index value for the shader sampler (as returned by the function shader_get_sampler_index(), and then one of the constants listed below.

ConstantDescription
mip_offMipmapping is disabled.
mip_onMipmapping for all textures is enabled.
mip_markedonlyMipmapping is enabled for textures that have it enabled in the Texture Group options (default).

 

Syntax:

gpu_set_tex_mip_enable_ext(sampler_index, setting);

ArgumentTypeDescription
sampler_indexShader Sampler HandleThe index of the shader sampler to get
settingMipmapping ConstantThe mipmap setting (a constant, default: mip_markedonly)

 

Returns:

N/A

Example:

var _sampleIndex = shader_get_sampler_index(shd_Glass, "s_Background");
var _spriteTex = sprite_get_texture(sprite_index, 0);
shader_set(shd_Glass);
if (gpu_get_tex_mip_enable_ext(_sampleIndex) != mip_on)
{
    gpu_set_tex_mip_enable_ext(_sampleIndex, mip_on);
}
texture_set_stage(_sampleIndex , _spriteTex);
shader_reset();

The above code enables mipmapping for the given shader texture sampler if it has not already been enabled.