HDR Lighting Settings

Category:Level DesignCategory:Lighting
== Overview ==
This article explains some of the more advanced techniques that can be used with HDR lighting. See HDR Lighting Basics for a description of the standard HDR methods.
==Add a Custom env_tonemap_controller==
Our example map also contains the entities to demonstrate the HDR effects. The first entity that needs to be placed is an . This entity can control the HDR settings in the map and allows us to override the default HDR values. Go ahead and name it tonemap.
Now we can trigger this entity a couple of ways, here we show a logic_auto entity that was used to set the settings on level spawn. The Inputs on env_tonemap_controller that are of interest are:
;SetAutoExposureMax:Sets the brightest level the exposure will go.
;SetAutoExposureMin:Sets the darkest level the exposure will go.
;SetBloomScale:Sets the bloom scale in the level.
=== Important Note ===
If the level is using an , console commands used to change HDR values cannot be used directly. Instead, the env_tonemap_controller entity inputs must be fired to change the settings. This can be done via standard entity I/O or using the ent_fire command with the following format:
ent_fire <env_tonemap_controller name> <input name> <new value>
For example, if your env_tonemap_controller is named tonemap_global, you would use the following commands:
ent_fire tonemap_global SetBloomScale 3
ent_fire tonemap_global SetAutoExposureMax 6
ent_fire tonemap_global SetAutoExposureMin .8
==Adding a Triggerable env_tonemap_controller==
The env_tonemap_controller can also be triggered with a . Here we see a trigger that changes the HDR values when the player enters the house. We state that this is single-player only because if these values change they would change globally affecting all players.
== Adding Different Lighting Values for LDR and HDR Modes ==
All entity lights and texture lights using lights.rad have the ability to contain two sets of lighting for LDR + HDR. In general, HDR lighting needs to be slightly less intense than the LDR values for a couple of reasons. Firstly, HDR has auto exposure to compensate for the darker areas and brighten the spaces. Secondly, bloom effects have the tendency to over-brighten certain surfaces, so toning down the light values also helps in this regard.
=== Environment Lights ===
Here is a screenshot of the entity with the HDR settings. The default values for BrightnessHDR and AmbientHDR are (-1, -1, -1, 1), which means to use the same settings as LDR. To change the HDR values, just enter your new values into these fields.
=== HDR Texture Lights ===
The lights.rad file, which controls "texture" light values, also allows for an independent HDR setting. The highlighted numbers above shows how the 2nd set of 4 numbers apply to the HDR values (R, G, B, intensity), if a 2nd set of numbers isn't entered vrad will use the LDR settings by default.
=== Other Lights ===
Other types of Source lights, including and , also have HDR values. You can set the HDR values for these lights in the same way you set the light for light_environment entities.
== More HDR Console Commands ==
Here is a list of commands that can be used at the console to dynamically edit your HDR settings in the engine.
== See also ==
* HDR Lighting Basics
* HDR Skybox Creation
*