Half-Life 2: Best autoexec.cfg for 20th Anniversary Edition

The primary objective is to enable the new “Classic Effects” while forcing the engine to utilize modern VRAM and CPU thread counts that the original 2004 code couldn’t conceive.

File Path & Setup

  1. Navigate to: C:\Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2\cfg\
  2. Create/Edit: Create a new text file and name it autoexec.cfg.
  3. Pro Tip: To ensure the config executes every time, add +exec autoexec.cfg to your Steam Launch Options. The Anniversary Edition also natively supports the -vulkan renderer, which we recommend for modern NVIDIA/AMD cards.

Optimized “Anniversary Ultra” Configuration Table

ParameterRecommended ValueTechnical Purpose
r_classic_blood1Enables the original, more visceral blood decals from 2004.
r_classic_fire1Restores the legacy fire sprites that were lost in the Orange Box update.
mat_picmip-10The Master Fix. Forces the highest texture resolution possible.
cl_detaildist2400Doubles the distance at which grass and small debris are rendered.
r_lod0Disables Level of Detail (LOD) swapping; models stay high-poly at all distances.
// Anniversary Classic Restorations
r_classic_blood 1
r_classic_fire 1
r_radiant_fog 1
r_flashlightculldistant 0

// Physics & High-Refresh Stability
fps_max 144 // Set to your monitor's refresh rate
cl_forcepreload 1
sv_forcepreload 1
cl_ragdoll_collide 1

// Graphics & LOD Pushing
mat_picmip -10
r_lod 0
cl_detaildist 2400
cl_detailfade 800
r_propsmaxdist 3000
mat_compressedtextures 0

// Modern Lighting & Shadows
r_shadowmaxrendered 64
r_shadowrendertotexture 1
r_shadows 1
mat_filterlightmaps 1 // Enables the new bicubic filtering

HowTo: Engineering the 2026 Source Pipeline

Follow these GameEngineer.net technical steps to optimize the Anniversary engine:

  1. Restoring the 2004 Aesthetic: The Anniversary Update added r_classic_blood and r_classic_fire. Enabling these in the autoexec.cfg ensures the game retains its original visual identity while benefiting from the new 4K UI and Vulkan backend.
  2. Texture Memory Override: Modern GPUs have 8GB+ of VRAM. Setting mat_compressedtextures 0 tells the engine to stop compressing assets, leading to significantly sharper decals and environment textures without any performance penalty on 2026 hardware.
  3. Bicubic Lightmap Filtering: Ensure your Shader Detail is set to “Very High” in the menu. In the config, mat_filterlightmaps 1 works with this to smooth out the jagged shadows originally seen on walls and floors, providing a much softer, modern look.
  4. Physics Consistency: For 144Hz+ monitors, set fps_max to your exact refresh rate. Source Engine physics can become “jittery” if the FPS fluctuates wildly ($FPS_{delta} > 50$). Capping it ensures the Tick Rate remains steady.
  5. The “Lambda” Decal Fix: The 20th Anniversary Edition fixed decals vanishing during map transitions. By setting cl_forcepreload 1, we ensure all level assets are in the cache, eliminating the “stutter” that used to occur when walking through a load trigger.

Technical Explanation: Lightmap Filtering and Luxels ($L_x$)

In the Anniversary Edition, Valve introduced Bicubic Filtering for lightmaps. Traditionally, Source used Bilinear filtering, which created blocky shadows when the “Luxel” (lighting pixel) density was low.

$$Shadow\_Smoothness \propto \int (Bicubic\_Filter \times Luxel\_Grid)$$

By forcing the engine to use the highest shader path in the autoexec.cfg, we allow the GPU to perform a more complex interpolation across the lightmap grid. This results in shadows that appear high-resolution even on legacy geometry, bridging the gap between the 2004 map design and 2026 display standards.

Leave a Comment