How to make texture cast light.

I decided to make simple tutorial about it.
So there are few easy steps.

1: At first of all check if file named lights.rad exists in your game folder.
To do so open main folder where are all folders with materials, models, cfg etc are.
Example: C:\Program Files (x86)\Steam\steamapps\YOUR_STEAM\half-life 2 episode two\ep2
[img_thumb]http://i48.tinypic.com/2cenr0n.jpg[/img_thumb]

If you don’t have such file, create one using notepad.
If you have it, open it.

2:Now search for texture using hammer texture browser.
I’ll use one of my textures.

[img_thumb]http://i46.tinypic.com/2wozimc.jpg[/img_thumb]

As you can see, selected texture is ‘neths/neths_area1’ and this is what we are going to use so copy path of your texture.

3:Now when we have texture and lights.rad file, we are going to add line about this texture to it.
Paste path of your texture with color and brightness amount.
Example: neths/neths_area1 255 255 255 400
-----------^PATH---------------^R–^G–^B–^Brightness


**Result:**

[img_thumb]http://i49.tinypic.com/1ze9jtj.jpg[/img_thumb]

This makes me kinda not want to use the light entity ever again. Have an informative.

Thanks ! Very motivative

I seriously needed to know this. Thanks.

Always happy to help

Nice tutorial, although there are already things about this around it’s still useful!

i only made something like this a month or two ago, though either way it’s still good for the community to have some understanding as this can become very useful.

Would there be a way in the lights.rad to make it flicker? I hate how difficult it is to make good looking flickering lights in source.

Theres a reason.
Flickering lights will never look good because their bounces aren’t compiled as accurately.

This will be solved with dynamic lighting right?

Wait 8 months.

No, valves dynamic lighting (from the portal 2 trailer and demos) doesn’t bounce.

From what I know, you can if you make animating texture

The problem is that I’ve only achieved a reasonable effect through some hacky i/o work that turned the light on / off and changed the skin on a prop_dynamic at random intervals. It was an utter pain in the ass, but it looked better than a light flickering while the prop stays lit, so if there was a way to make a textlight flicker on top of the texture looking like it’s gone off, that’d be awesome.

Animated texture which uses two textures. Make one cast light and another one not. It will work perfectly

Short but covers the details pretty well. I’ve always strayed from doing this since I didn’t really need it, but I’m thinking of some ideas that would be very useful with this. All in all, this could definitely cut down on the entity count if you so chose to.

If you want it to be at all realistic, you need to make you texture a selfillum texture. It’s actually not too hard, just change the shader from “LightmappedGeneric” to “UnlitGeneric” and add two lines to the vmt (the second one is optional):

“$selfillum” 1
“$selfillummask” “path/to/selflilummask”

The selfillummask is a grayscale texture separate from the basetexture. The closer to white a pixel on the selfillummask texture is, the brighter it’s corresponding basetexture pixel glows.

And hostel, lights.rad just places light entities next to textures defined in lights.rad, it doesn’t cut down entity count AFAIK.

I thought it cuts down on it because it’s not actual in-game light, but instead just uses the textures to help increase ambient light baked into your textures.
I’m pretty sure that it’s only adding light to the lightmaps and if you move a model near it, the model will not get any brighter.

It works like light source is under texture, like lights in school classes where lights are covered with some white box. It works like that

oh wait, you are right. It would have some mention of lights.rad in VBSP if it were to actually add light entities. I think it’s just setting up temporary points with specific light properties then calculating lightmaps from that, using 0% entdata.

But really, I’ve seen people hit 200% the entdata limit, You really shouldn’t be worried about the number of entities in your map.

Light.rad is actually making light on lightmaps. Sadly this light isn’t as quadratic as I wish it to be :smiley: You know, light that has shape of brush which uses light texture, would be awesome