gpu_set_fog


描述

This function can be used to enable or disable fog drawing. Fog can be used in 3D games to make instances in the distance look blurred or even disappear, which helps in creating atmosphere as well as masking the fact that you are not drawing instances that are far away. You set whether it is enabled (true) or disabled (false), the colour that the fog should use for blending, as well as the start and end draw distances. Note that the fog start indicates the radius relative to the view camera where the fog starts, and the fog end indicates at which radius (also relative) instances will be completely invisible.

The function can take four individual arguments (given above) or an array with the following structure (the example code below shows this method):


语法:

gpu_set_fog(enable, colour, start, end);


参数:

参数 描述
enable Enable or disable fog
colour The fog colour
start The distance to start applying fog from
end The distance to end the fog


返回:

N/A(无返回值)


例如:

var fog_a = gpu_get_fog();
fog_a[1] = c_red;
gpu_set_fog(fog_a);

The above code gets the current fog settings and then sets the colour element of the array to c_red before setting the fog again using the changed array.


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