gpu_get_tex_mip_enable_ext


描述

With this function you can get 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 the function will return one of the constants listed below.


语法:

gpu_get_tex_mip_enable_ext(sampler_index);


参数 描述
sampler_index The index of the shader sampler to get


返回:

Constant:

常量 描述
mip_off Mipmapping is disabled.
mip_on Mipmapping for all textures is enabled.
mip_markedonly Mipmapping is enabled for textures that have it enabled in the Texture Group options.


例如:

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.