gpu_get_tex_min_mip_ext

使用此函数可以获得给定着色器采样器当前使用的最小mipmap级别。为着色器采样器提供索引值(由函数shader_get_sampler_index()返回),该函数将返回值0(表示完整分辨率)、1(表示第一个mipmap)、2(表示第二个mipmap)等...

 

语法:

gpu_get_tex_min_mip_ext(sampler_index);

参数类型描述
sampler_index着色器采样器控制柄要获取的着色器采样器的索引

 

返回:

Real (default: 0)

 

例子:

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_min_mip_ext(_sampleIndex) != 0)
{
    gpu_set_tex_min_mip_ext(_sampleIndex, 0);
}
texture_set_stage(_sampleIndex , _spriteTex);
shader_reset();

上述代码将给定着色器纹理采样器的最小mipmap级别设置为0(如果尚未将其设置为0)。