使用此函数,可以设置给定着色器采样器当前使用的最小mipmap级别。为着色器采样器提供索引值(由函数shader_get_sampler_index()返回),然后提供一个值,其中0表示完整分辨率,1表示第一个mipmap,2表示第二个mipmap,等等...
gpu_set_tex_min_mip_ext(sampler_index, minmip);
参数 | 类型 | 描述 |
---|---|---|
sampler_index | 着色器采样器控制柄 | 要获取的着色器采样器的索引 |
minmip | Real | 要使用的最低mipmap级别 |
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_min_mip_ext(_sampleIndex) != 0)
{
gpu_set_tex_min_mip_ext(_sampleIndex, 0);
}
texture_set_stage(_sampleIndex , _spriteTex);
shader_reset();
上述代码将给定着色器纹理采样器的最小mipmap级别设置为0(如果尚未将其设置为0)。