CEnvTonemapController

From Source Entities
Jump to navigation Jump to search

Code classes:

Env tonemap controller.png

CEnvTonemapController controls tonemapping. Think of it as a method of controlling how the player's pupils adjust as they look at areas of different brightnesses. Also controls bloom. To see the effects of this, the map must be compiled with HDR (check the HDR box in the compile options, or use -hdr or -both on the VRAD command line) and the player in question must have HDR enabled in their video settings. (HDR is always enabled in some games. If you don't see the option for it, it's on.)

Classnames:

  • env_tonemap_controller
  • env_tonemap_controller_ghost (only available in L4d.pngL4d2-small.png) - Used in Versus mode for zombie players that have not physically spawned into active gameplay yet.
  • env_tonemap_controller_infected (only available in L4d.pngL4d2-small.png) - Used in Versus mode for zombie players that have physically spawned into active gameplay.

Tonemapping affects all players at once in multiplayer, unless if it's changed by using fog_volume (and with the exception of player zombies in L4d.pngL4d2-small.png). HDR settings should otherwise be changed through triggers, whenever transitioning between environments of different light levels.

Bug: In rare circumstances, the renderer will re-decide if the scene is bright or dark depending on the tonemapping and bloom alone, leading to a map-wide strobe effect.

Fix: This is usually a sign that the settings are too extreme. Tone them down.

Flags[edit | edit source]

  • 1: Master (available in all games since L4d.png) - For use with trigger_tonemap. If no other tonemap entities are active, the game will default to this one (usually ideal for HDR settings while outdoors).

Inputs[edit | edit source]

SetAutoExposureMin <float>
Sets exposure level when looking at bright things. (Darkens environment in response.)
SetAutoExposureMax <float>
Sets exposure level when looking at dark things. (Brightens environment in response.)
SetBloomScale <float>
Sets how intense bloom is. Does nothing in L4d.pngL4d2-small.png.
SetTonemapRate <float>
If set to less than 1.0, divides the time it takes to transition between exposure levels by that much.
UseDefaultAutoExposure
If either SetAutoExposureMin or SetAutoExposureMax has been used, sets their values back to their defaults. (Determined by mat_autoexposure_min and mat_autoexposure_max.)
UseDefaultBloomScale (Not in FGD)
If SetBloomScale has been used, sets the value back to its default. (Determined by mat_bloomscale.)
SetTonemapScale <float>
No effect.
BlendTonemapScale <float>
No effect.
SetBloomScaleRange (Not in FGD) <float>
Broken.
SetBloomExponent <float> (available in all games since L4d.png)
To do: Description.
SetBloomSaturation <float> (available in all games since L4d.png)
To do: Description.
SetTonemapPercentTarget <float> (only available in L4d2-small.pngCsgo-small.png)
Sets how bright the percent of pixels set by SetTonemapPercentBrightPixels should be.
SetTonemapPercentBrightPixels <float> (only available in L4d2-small.pngCsgo-small.png)
Sets the percent of pixels that should be brightened by the amount specified by SetTonemapPercentTarget.
SetTonemapMinAvgLum <float> (only available in L4d2-small.pngCsgo-small.png)
To do: Description.