d3d_set_fog

Enables or disables the use of fog.

Syntax:

d3d_set_fog(enable, colour, start, end)


Argument Description
enable Turn fog on (true) or off (false).
colour The fog colour.
start The distance where polygons start to be blended with the fog colour.
end The distance at which fog is maximal and nothing can be seen anymore.


Returns: N/A


Description

Fog can be used in 3D games to make objects in the distance look blurred or even disappear, which helps in creating atmosphere and it also masks the fact that you are not drawing objects that are far away. Note that The fog start indicates the radius relative to the viewpoint where the fog starts, and the fog end indicates at which radius (also relative) objects will be completely invisible.


Example:

d3d_set_fog(true, c_white, 1000, 2000);

The above code sets the fog for a 3D game.


Back: 3D Drawing
Next: d3d_set_lighting
© Copyright YoYo Games Ltd. 2018 All Rights Reserved