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.
常量 描述 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 (default).
gpu_set_tex_mip_enable_ext(sampler_index, setting);
参数 | 描述 |
---|---|
sampler_index | The index of the shader sampler to get |
setting | The mipmap setting (a constant, default: mip_markedonly) |
N/A(无返回值)
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.