HL2’s lights.rad is incomplete, so many fences throw solid shadows.This guide has the fix and shows you how to install it.
Foreword
Not every fence does it. But models/props_c17/fence01a.mdl does.
Some plants probably do it as well.
Now what causes this?
Every source engine game has a file called Lights.rad.
This file defines what models should have shadows based on its transparency.
But this file is missing various models, so it just does not compute proper shadows.
This means we need to add all the props that should have shadows to this file.
Unfortunately for us, the original lights.rad for EP1, EP2 and LostCoast are inside a vpk.
If we wanted to edit the original file, we’d need to repack the entire content of that vpk.
But that is painful, so we’ll instead add a completely new one and always use it along the original.
So, let’s get started.
Setup
Go to where Half-Life 2 is installed on your machine.
Same folder as “hl2.exe”
Create a folder called “vrad_fix”
Inside this folder, use the search function of your pc to look for “gameinfo.txt”
Open all of these in your text editor.
In every single gameinfo.txt, scroll down until you see the SearchPaths
Right below the opening bracket {, add the following line:
game vrad_fix
This will make the game load data from the “vrad_fix” folder.
EVERY SINGLE GAMEINFO NEEDS THIS!
Even the ones you may have previously added yourself, for map specific content.
Install
“Bigger_lights.rad” Contains only the models that had “Fence” and “foliage” in the name.
“HUGE_lights.rad” Contains every model except weapons and animation models. Lmao.
Generally, “Bigger_lights.rad” is good enough. But if you spot a model that for some reason still has solid shadows, you can use the “HUGE_lights.rad” to make sure that every model has correct shadows. But that could perhaps make compile times longer than you want.
But it would only compile shadows on static props anyways, so it won’t be that bad.
Download one, or both of those rad files to that “vrad_fix” folder.
Its in a zip file, so unpack it.
Usage
In Hammer, press F9 to compile the map and pick expert compile settings.
Click the “Edit” button and pick any of the prefabs you want to edit, then copy it to alter it.
We’re doing it like this so you have setups for both rad files, along with the original ones.
In the $lights command, use the following text to get the correct light compile settings:
-lights Bigger_lights.rad -hdr -TextureShadows -staticproplighting -StaticPropPolys -game $gamedir $path\$file
The line you copied up there ONLY has -hdr.
That means “Low dynamic rage” is not compiled.
I am doing this on purpose just so i can compile tests way quicker, because i play in hdr.
No need to compile both ldr and hdr together just for tests.If you do final compiles you need to use -both -final instead of -hdr.
Or if you play on low settings, you need os use -ldr for test compiles!Authoring the graphic settings here is up to you!
If you want to use both rad files to switch between, you can just add yet another lights line.
You can toggle which to use by clicking the check boxes. I prefer it that way.
Click the “New” button and populate the fields with the same data, except for the other .rad.
Yeah that’s it. You’re done now.
Compile with either of these rad files being active and you’re good to go.
Not both at once, else it’ll just run vrad twice, which does nothing but waste time.
Closing words
Funny how Valve celebrated a 20 year anniversary of Half-Life 2 and never fixed this thing.
Good thing unpaid modders do it.
Should you need help with this modding, join the “Dead 4 Mods” Discord Server[discord.gg].
There’s a few members, including me, who can help you out.
If you join and immediately DM me, i’ll ignore you. Use the designated channels.
I have my own Discord Server[discord.gg] if you’d like to hop in and chat.
I sometimes post WIP images of what i’m doing, but it’s mostly memes.
I also got Paypal[paypal.me] for don’t-ations.
And that wraps up our share on Half-Life 2: Fixing Shadows (lights.rad). If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by мяFunreal, who deserves all the credit. Happy gaming!