Class VolumetricFog
Namespace: ValveResourceFormat.Renderer.SceneEnvironment
Assembly: Renderer.dll
The volumetric fog of a scene, from env_volumetric_fog_controller and its env_volumetric_fog_volumes. Each frame it lights the fog in a grid of the screen and accumulates the light along each ray, for the shaders to read as scatter + color * transmittance.
public sealed class VolumetricFog : IDisposableInheritance
object ← VolumetricFog
Implements
Constructors
VolumetricFog(RendererContext)
Initializes the fog of a scene.
public VolumetricFog(RendererContext rendererContext)Parameters
rendererContext RendererContext
The context to load the fog shader from.
Fields
GridDepth
Number of slices of the grid, from the camera outwards.
public const int GridDepth = 64Field Value
int
GridHeight
Height of the grid in cells.
public const int GridHeight = 160Field Value
int
GridWidth
Width of the grid in cells.
public const int GridWidth = 240Field Value
int
Properties
HasController
Gets a value indicating whether the scene has a fog controller.
public bool HasController { get; }Property Value
bool
NearRange
Gets the distance of the first slice from the camera, and the distance from it to the last slice.
public Vector2 NearRange { get; }Property Value
Volume
Gets the texture the fog is accumulated into, or null before the first frame.
public RenderTexture? Volume { get; }Property Value
Volumes
Gets the fog volumes of the scene.
public List<VolumetricFog.FogVolume> Volumes { get; }Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Render(Scene, Vector3)
Lights and accumulates the fog for the view that is bound.
public void Render(Scene scene, Vector3 cameraPosition)Parameters
scene Scene
The scene whose lights light the fog.
cameraPosition Vector3
The position of the view the fog is built for.
SetController(Entity)
Takes the fog settings of an env_volumetric_fog_controller.
public void SetController(EntityLump.Entity entity)Parameters
entity EntityLump.Entity
The controller's keyvalues.

