Post tutorial Report RSS Advanced Lighting

Using a combination of effects to achieve a nicer light effect

Posted by on - Advanced Mapping/Technical

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.

Tutorial Image

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.

Tutorial Image

Tutorial Image

Tutorial Image

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.

Tutorial Image

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.

Tutorial Image

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.

Tutorial Image

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.

Tutorial Image

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

Tutorial Image

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.

Tutorial Image

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.

Post comment Comments
micmac
micmac

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.

Reply Good karma Bad karma+3 votes
Arkanj3l
Arkanj3l

The sprites always have to have the extension ".spr" on them. Hammer doesn't do this at first, you have to add it yourself.

Reply Good karma Bad karma+2 votes
Psalm
Psalm

Though there are already a few lighting tutorials like this on Moddb, this one's pretty good! Nice work, SgtJman.

Reply Good karma Bad karma+2 votes
Biohaz@rd
Biohaz@rd

Very nice tutorial. I've found it preety useful. Thanks Sgt Jman :P

Reply Good karma Bad karma+3 votes
CrowbarSka
CrowbarSka

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...?

Reply Good karma Bad karma+3 votes
VolcomChamp
VolcomChamp

micmac, you have to add .vmt after the Sprite in the Sprite Name field.

Reply Good karma Bad karma+2 votes
mattman111
mattman111

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

Reply Good karma Bad karma+2 votes
Ripe
Ripe

mattman111, use light_spot not light_dynamic.

Reply Good karma Bad karma+2 votes
Feared
Feared

Images disappeared. :(

Reply Good karma Bad karma+2 votes
tymaxbeta
tymaxbeta

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...

Reply Good karma Bad karma+2 votes
half-life
half-life

ctrl+D = a bookmark of this page for me, I keep forgetting how to do this(3rd time I've had to learn it).

Reply Good karma Bad karma+2 votes
half-life
half-life

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. :(

Reply Good karma Bad karma+2 votes
half-life
half-life

sorry for three posts but i fixed the problem by using light_glow2_add or something.

Reply Good karma Bad karma+2 votes
func_incendiary
func_incendiary

Or you can change the render FX to glow.

edit:

Oh ****, I am a year late.

Reply Good karma Bad karma+2 votes
Holymac
Holymac

Great tutorial Man i really like it

Reply Good karma Bad karma+1 vote
nosfer4tu
nosfer4tu

Thank you so freakin much! i never knew about that trick with func_dustmode and env_sprite T_T

Reply Good karma Bad karma+1 vote
Mooneh
Mooneh

hey nice tut, where are those lampsmodels from i rly love em and wanna use something that looks like it for my map ^^

Reply Good karma Bad karma+1 vote
MNKYband
MNKYband

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

Reply Good karma Bad karma+1 vote
MNKYband
MNKYband

Nevermind, I fixed it. But now my zombies' heads are all shiny, even when they are out of the light. Help?

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: