Wednesday, August 22, 2012

Fix Half Life 2 lighting issues



Solution:

  • You need to be using a video card that supports DirectX 9 and the DirectX level in Half Life 2 needs to be 90 or higher. In the console, type mat_dxlevel to see the directx level. To set it to 90, for example, type mat_dxlevel 90

  • HDR needs to be fully enabled. The easiest way to do this (after correctly setting the directx level) is by typing this in the console: mat_hdr_level 2 and then type mat_hdr_enabled to make sure HDR is in fact enabled.

  • Lastly, if the lighting is still messed up, type mat_fullbright 0 in the console to fix it.

  • An alternative is to download these files:
    http://uploading.com/b84125d7/ldr_fix-exe
    http://uploading.com/3mb5mdm9/sky_fix-exe

    Open them to extract the files (in Linux, you can open them using Wine). Then copy the files to SteamApps/common/Half-Life 2/hl2/maps in your Steam installation folder (~/.local/share/Steam on Linux, or in C:/Program Files on Windows).

Details:

I was recently playing Half Life 2 on Linux using Wine, and at one point, all the lighting messed up. It basically looked like there were no shadows at all. The screenshot above is supposed to be in a dark tunnel.

Supposedly this was caused by an update to the Half Life 2 maps when the orange box was released. Somehow or another, some of the maps require HDR to be enabled for the lighting to work. HDR is only supported in DirectX 9 and higher, and I was setting the DirectX level to 80 (DirectX 8.0) by using the -dxlevel 80 flag in the launch options. I had to remove that flag, and then take the steps above to fix the problem.

Once I did fix the lighting, the game got significantly slower. Still playable, but a lot more annoying to play. Using some of my tips on playing Half Life 2 on an older computer helped, but some of the textures are messed up.  This may affect other source games as well.

Now that Half Life 2 is playable natively on Linux, this is issue will probably only affect Windows users.

0 comments:

Post a Comment