Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 59 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
HL2
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Texture Lighting
Versions: You must be logged in to view history.
N shows us how to create textures that give off light.
One of my favorite things about the Source engine, and the Hammer editor, is a function of lighting known as texture lights.   They  might seem confusing at first, but they are very easy to use, intuitive, and in the end I think provide MUCH better lighting than point lighting.  But enough of that, I'm just here to tell you how to use or implement them, and then you can see for yourself how they look.

Some facts about what we're talking about:

1. Texture lights are defined in a simple text file with the extension .rad
2. Normally this file is called lights.rad, but we'll be changing this to the name of our map
3. Texture lights have basically a three part definition:  the texture name, the color of the desired light, and the brightness of the light.

Alright, so you want to include texture lights in your map, here's how you would do it.    Let's consider that we are making ourselves a half-life 2 multiplayer map, called "mp_light_test"

So we create our map in Hammer, and we save it (not compile it).   Where is the map saved?  Typically this would be something like:

..\Valve\Steam\SteamApps\maldevane\sourcesdk\hl2mp_sample_content\maps\mp_light_test.vmf

Alright, so in this same location, we are going to create a new blank text file and call it "mp_light_test.rad", so that the directory now has both the map (vmf file) and our .rad file in it.

So, in our map, we put in some flourescent light looking textures that we want to emit a cool blueish glow.  We need to write down or remember the name of the texure.  In our texture browser the texture in question has the name of:

lights/fluorescentcool001a

Open up the .rad file in notepad.   And on the first line, we'll enter in "lights/fluorescentcool001a" and then follow it up with a tab.  We'll now be entering four numbers.   The numbers, in their order of entry are:

    red value, green value, blue value, brightness

We want this light to have a sort of cold blue light, so we need to get the RGB values of such a color.   You can find this using paint, even, by creating a custom color and looking at the red, green, and blue values listed in the color custom panel.  These values we then add in next to our texture listing, and have a line that should now look like the following:

lights/fluorescentcool001a    230 240 247

The last number we need to enter is the brightness of the light.  This can be from very dim to very bright; I'm not sure of the minimum and maximum, but I believe values even into the thousands will work for bright worklights or small instrument panel lights.  But we want these to be regular shop lights, so we'll pick a brightness of 375, for a semi-bright blueish glow.   The final line for our texture light definition should now look like this:

lights/fluorescentcool001a    230 240 247 350

That's basically it -- further texture light definitions just go down on the next line, etc etc.   For example:

lights/hazzardred001a    228 37 0 300
lights/hazzardyellow001a    250 215 74 300

lights/HIDcool001a        145 222 172 650
lights/HIDcool001b        205 232 255 650
lights/HIDwarm001a        255 201 116 650

is a section of the lights.rad file that is the base for Half-Life 2's lights.rad file.  Texture lights defined in your map should overwrite the values in the master .rad file, but I'm not one hundred percent sure of this.   Basically, though, making a concise .rad file for your map is the way to go, as it allows you to change the brightness and color for a large number of lights at one time.

So now that we have our map file and the defined .rad file in the same directory, we go ahead and compile the map.   In the status window for the map's compile, you should scroll up and see where it has read in your .rad file and parsed through how many ever texture lights you have defined and used them in radiosity calculations.

Experiment and have fun -- things like vending machines, neon signs, and other subtle lighting effects look REALLY sharp when defined using texture lights in this fashion.  Multiple colored/light vending machines with combined texture lights for flourescent lights and the red glow of an exit sign, are all very easy to define and control, and provide a solution that really provides an atmospheric touch to the lighting of your map!

--N--

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»