gpu_set_alphatestenable


描述

This function will enable or disable alpha testing for your game (by default this is disabled). By switching alpha testing on you can then use the companion function gpu_set_alphatestref to set the "cut-off" value at which all alpha values will be set to 0. The image below shows the difference that can be seen when alpha testing is switched on or off:

NOTE: This function may negatively affect performance on iOS, Android and Windows Phone devices.


语法:

gpu_set_alphatestenable(enable);


参数:

参数 描述
enable Enable or disable alpha testing (true / false)


返回:

N/A(无返回值)


例如:

if !gpu_get_alphatestenable()
   {
   gpu_set_alphatestenable(true);
   gpu_set_alphatestref(128);
   }

The above code will check to see if alpha testing is enabled and if not it will switch on alpha testing and set the test threshold to 128 (only pixels with an alpha over 0.5 will be drawn).


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