Vital.sandbox
GFXFog

gfx.fog.set_depth_begin

Client

The depth begin distance to be set for the fog post-processing effect


Syntax

local status = gfx.fog.set_depth_begin(value)

Only available when the fog mode is set to depth mode. Refer gfx.fog.set_mode to configure the active fog mode.

  • Depth mode required — calling this function in any other fog mode will have no effect
  • Recommended usage — set depth_begin less than depth_end to define a valid and visible fog transition range

Parameters

TypeNameDescription
floatvalueDepth begin value to be applied
Sets the distance from the camera at which depth-based fog starts to appear. Geometry closer than this distance will not be affected by fog

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Start fog at 10 units from the camera
--Start fog at 10 units from the camera
gfx.fog.set_depth_begin(10.0)

On this page