使用此函数可以获得给定着色器采样器当前使用的最小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)。