gpu_set_texfilter_ext


描述

This function can be used to set the linear interpolation for a single sampler "slot" when using Shaders in GameMaker Studio 2. When this is enabled (true) the sampler texture will be smoothed and if this is disabled (false) then images will be drawn based on the nearest pixel. The default value is that set by the Global Game Options for your game, or that set using the function gpu_set_texfilter.

NOTE: This setting will be over-ridden by the value set when calling the function gpu_set_texfilter.


语法:

gpu_set_texfilter_ext(sampler_id, enable);


参数:

参数 描述
sampler_id The sampler id from the shader.
enable Enable or disable texture filtering (true / false)


返回:

N/A(无返回值)


例如:

var s_tex = shader_get_sampler_index(shader_glass, "s_NoiseSampler");
if gpu_get_texfilter_ext(s_tex)
   {
   gpu_set_texfilter_ext(s_tex, false);
   }
else
   {
   gpu_set_texfilter_ext(s_tex, true);
   }

The above code checks to see if texture filtering is on or off for a specific sampler ID (stored in a local variable) and switches it accordingly.


上一页: GPU Functions
下一页: gpu_set_texrepeat
© Copyright YoYo Games Ltd. 2018 All Rights Reserved