Tutorial: Advanced Lighting
SgtJman
Sourced from Leak-free.net
Intro:
Most people who map in hammer use the light entity to create their desired lighting effects. When investigating with lighting the first time they might try a light_spot, but find it too dull with horrid beam angles, so they’ll stick with the light method. Now this is not the “wrong” way of doing things, but there is a better way.
By looking at the way Counter-Strike and Half-Life 2 maps are made there are a lack of light entities and an abundance of light_spot entities. This might seem odd, as from what we’ve seen light_spots are shitty, but valve use them everywhere.
Light_spots are, once you know how to use them, a much more natural lighting effect than lights, they are directed, light bulbs usually have a 75 degree angle, not 360. the Light_spot method combined with a few other techniques can really improve the lighting in your maps.
Prop_static:
Lights look stupid unless they are coming from somewhere, a good prop_static gets rid of this problem. A good way to find one is simply search “light” in the model selecting GUI. I decided on models/props/cs_office/light_shop.mdl
Light_spot:
Place and aim the light_spot where you want it, in our case it is aiming directly down and placed right underneath the chosen model. Be careful not to let the origin of the entity (small cross in middle of 2d view) intersect with any geometry or it will not work correctly.
Pitch changes the, well, pitch, the default is -90, we won’t need to change it.
Change the beam angles; there are two to change, the inner (bright) and outer (fading) angles. If you want a light bulb effect choose 30-60 for the bright angle, and anything larger than this for the fading angle. I choose 60 and 75.
To sort the color and intensity change brightness, this is the same with lights. Brightness is set up with standard RGB inputs, but the fourth is intensity. Lights have a default of 500, light_spots 200, which explains why they shunned due to dullness. Change this value to 400-600, I’m using 500. The color you choose should be faded and dull, never choose white, no lights are white, light bulbs are yellow, fluorescent lights blue. I’m using 201 213 224 this is probably the closest you’ll want to get to blue. The other settings can be tinkered with, but don’t really make it any nicer looking. If you are using HDR, you don’t need to change anything settings, its all automatic.
Env_sprite:
To give a light that glow effect, the best choice is env_sprite of env_lightglow. Personally I use the env_sprite because valve also use them a lot, and they know what they are doing.
Place the env_sprite either very close, or inside the light model. If it is a long light, two or three may be required.
Firstly choose your sprite name, any of the “light_glow” series will be perfect. I choose light_glow3.
NOTE: You must add “.vmt” after the string or it won’t load the sprite material
Now you need to set the sprite up to work as a lighting sprite. Change the render mode to world space glow, change the FX amount to somewhere between 100 and 255, depending on how bright you want it to seem, I’m using 200. You also need to choose your FX color, you can just copy over your light_spots color here to get the desired effect.
If you wish, change the scale, 0.75 works pretty well, so I’m using that.
Size of proxy geometry refers to how much space the sprite needs to be in front of geometry, if it is inside a model for example. Don’t make it too large of it will appear though unwanted geometry. I’m using 3.
Also tick Start On in the flags
Func_dustmote:
Sometimes when you see light beams there are bits of dust floating underneath, though they seem to disappear as soon as they leave the light beam. This would be neat to see in a map, luckily, the source engine make this easy to replicate.
Create a cone brush, clip off the top, and stretch to the size of your light. Tie it to a func_dustmote. You can use any texture for this brush, I use trigger, but this may cause engine problems or confusion with trigger entities, so nodraw might be a better alternative.
The particle color should be the same as your light_spot and env_sprite.
Particles per second, is how dense you want your particles, 10 works for me
Minimum particle size around 10, maximum around 15, alpha 255.
Note:
If you find by using the light_spot your ceiling is too dark, simply add a dull (around 50) light_spot about 32 units off the ground, facing up (pitch 90) with a wide angle to make it more real.
hey! awesome tutorial the only problem was the sprites arnt showing up! i get everything else to work but the sprites... can you maybe put on a example vmf or somthing.
The sprites always have to have the extension ".spr" on them. Hammer doesn't do this at first, you have to add it yourself.
Though there are already a few lighting tutorials like this on Moddb, this one's pretty good! Nice work, SgtJman.
Very nice tutorial. I've found it preety useful. Thanks Sgt Jman :P
This is probably one of the best lighting tutorials I've seen and it gives really great results, just like professional Valve lighting.
Maybe worth mentioning point_spotlights as well...?
micmac, you have to add .vmt after the Sprite in the Sprite Name field.
ok it worked spirtes worked but when ever i go in the map the light is working but the whole map is perfectly lighted like no lights what so ever i want a darkish night map not a perfectly lighted map [with no light] make a tutorial how to make a nightish , dark map that you have to use your flash light
mattman111, use light_spot not light_dynamic.
Images disappeared. :(
a note to everyone, the only texture a func_dustmote will properly appear in game with is the trigger texture, if anyone has an issue with they're "dust" not appearing in game, that is most likely it...
ctrl+D = a bookmark of this page for me, I keep forgetting how to do this(3rd time I've had to learn it).
How do I get rid of the black border? It was working fine but when I did a compile this morning it had a black box around the sprite. :(
sorry for three posts but i fixed the problem by using light_glow2_add or something.
Or you can change the render FX to glow.
edit:
Oh ****, I am a year late.
Great tutorial Man i really like it
Thank you so freakin much! i never knew about that trick with func_dustmode and env_sprite T_T
hey nice tut, where are those lampsmodels from i rly love em and wanna use something that looks like it for my map ^^
My map is always all lit up, and I can't put in a dark zone. Can someone tell me how to fix this?
Thanks,
MNKYband
Nevermind, I fixed it. But now my zombies' heads are all shiny, even when they are out of the light. Help?