This article relates to the game "Left 4 Dead". Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

VRAD HDR Crash Fix

From Valve Developer Community
Jump to: navigation, search
Underlinked - Logo.png
This article needs more links to other articles to help integrate it into the encyclopedia. Please help improve this article by adding links that are relevant to the context within the existing text.
January 2024
English (en)中文 (zh)
... Icon-Important.png

Note.pngNote:(in all games since Source 2007) This fix has been fixed. Only Source 2006 Source 2006 and Left 4 Dead Left 4 Dead mappers still have to apply it manually.

This fix applies to instances where VRAD crashes as it begins the HDR lighting pass while using the switch -both. The LDR part of the compile typically completes without error, but once the HDR part starts, VRAD crashes without an error message.

Solution

Splitting the LDR and HDR passes in vrad.exe execution seems to prevent this crash from occurring. This is as simple as defining 2 VRAD commands—one using the -ldr switch and the other using the -hdr switch—instead of just one using the -both switch in Hammer's compile configuration. The following will detail what you can do in Hammer to achieve this.

Credit to Xanthi of the Steam User's forum for bringing this fix to light.

Setting up Hammer

  1. Open up the Run Map dialog (File > Run… or F9) in Hammer.
  2. If not already in "Expert Mode", click the "Expert" button in the bottom left of the dialog.
  3. Select "HDR Full Compile" from the Configuration pull-down.
Note.pngNote:In this example, we are editing the existing "HDR Full Compile" configuration to apply the fix. The following steps can be used for the "HDR Full Compile -final (Slow)" configuration by maintaining the -final switch in the Parameters box.
  1. Select the 3rd item down, which should say $light_exe -both -game $gamedir….
  2. In the text box labeled "Parameters", along the right of the dialog, change the switch -both to -ldr. It should now read -ldr -game $gamedir $path\$file.
  3. Click the "New" button to create a new command in the configuration and select the new blank command at the bottom of the list.
  4. Press the "Move up" button twice to move the new command to right under the command you just edited.
  5. Enter $light_exe into the text box labeled "Command," or use the "Cmd" button to the right and select the "LIGHT Program" option for the drop-down menu.
  6. Into the "Parameters" text box, enter: -hdr -game $gamedir $path\$file.

You now have a fixed HDR compile configuration in Hammer. You must use this configuration in "Expert" mode. "Normal" mode will still use the -both flag for HDR compiles.