Advanced Lighting

Tutorial collection, comprehensive listings on main site.

Advanced Lighting

Postby Tutorial on Fri May 11, 2007 6:46 pm

category
General Half-Life 2/Lighting

description
A look at several ways to light your map.

keywords
light, lights, lighting, light_spot, spot, advanced.

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.

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.

Image

Image

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.

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.

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.

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.

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

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.

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.

SgtJman
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby SlappyBag on Fri May 11, 2007 6:56 pm

What I tend to do is pair my point_spotlights with a dull light entity, you know, bouncing light an all.

Other then that, very good tutorial.
User avatar
SlappyBag
Veteran
Veteran
 
Joined: Sun Jun 26, 2005 9:16 am
Location: Brighton, UK

Postby Blink on Fri May 11, 2007 6:59 pm

Very good tutorial, sorry I took so long posting it.

Regarding the dark ceilings, just increase the brightness of the light_spot, problem solved.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby SlappyBag on Fri May 11, 2007 7:19 pm

Blink wrote:Very good tutorial, sorry I took so long posting it.

Regarding the dark ceilings, just increase the brightness of the light_spot, problem solved.


But what if the floor becomes washed out?
User avatar
SlappyBag
Veteran
Veteran
 
Joined: Sun Jun 26, 2005 9:16 am
Location: Brighton, UK

Postby Oakley on Tue May 29, 2007 10:31 pm

Yeah what I do is stick a light entity inbetween the light_spot and the ground, this works a treat and has always looked fine to me as the light would do this, shine out in all directions.
As for env_sprites I have always used env_lightglow but I might have a try with sprites because I like the effect you have got here.
Image
User avatar
Oakley
1337 p0st3r
1337 p0st3r
 
Joined: Mon May 28, 2007 11:05 pm
Location: The Internets

Postby k-dawg on Wed Aug 15, 2007 7:45 pm

i must be screwing things up horridly, the sprite loads just fine but the sprite shows through every single wall in the map... please help?
waisted menkey wrote:i do however appreciate your efforts at telling me how wrong i am and how right you are. that's awesome!
:smt019
k-dawg
Regular
Regular
 
Joined: Sat Aug 11, 2007 2:55 am
Location: San Diego CA

Postby Mattc0m on Sat Aug 18, 2007 9:12 pm

Excellent tutorial, I found the sprite idea (having multiple sprites per light source) a very good idea.

I have a question, however. Is there a difference between adding .vmt or .spr? Will it achieve the same effect?

Also, another question. Is "world space glow" the best render mode, or is there others that useful? Which ones should I consider using / what are the differences between them?

Thanks!
Mattc0m
Member
Member
 
Joined: Fri Jul 27, 2007 7:40 pm

Postby ForceFist on Sat Aug 18, 2007 9:20 pm

It looks very nice with the use of sprites but don't overuse it :lol:
Current Project:
The Bunker
A One-Man-Mod
User avatar
ForceFist
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Fri Jul 27, 2007 8:08 pm
Location: Sweden

Postby EagleStrike on Mon Nov 19, 2007 8:00 pm

Any chance of a .vmf for this? I can't get the sprites right. The glow just isn't there...
As I Walk Through The Valley Of Death, I Will Fear No Evil, Cos I'm The Meanest Fucker In The Valley...
EagleStrike
Pheropod
Pheropod
 
Joined: Sun Dec 03, 2006 7:26 pm
Location: London, England

Re: Advanced Lighting

Postby kkirspel on Mon Jan 05, 2009 7:49 pm

(Wow, I'm really on a roll with these bumps... sorry)
[quote="Mattc0m"]
I have a question, however. Is there a difference between adding .vmt or .spr? Will it achieve the same effect?
Also, another question. Is "world space glow" the best render mode, or is there others that useful? Which ones should I consider using / what are the differences between them?
quote]
I found tmyself asking these questions also...
The inspiration as to why I'm here: Adam Foster; Minerva. Great job man.
User avatar
kkirspel
Pheropod
Pheropod
 
Joined: Wed Dec 03, 2008 6:34 pm
Location: Columbus, GA, USA

Re:

Postby Chopium on Tue Jun 16, 2009 7:03 am

k-dawg wrote:i must be screwing things up horridly, the sprite loads just fine but the sprite shows through every single wall in the map... please help?

It will always do that in hammer, but not in-game.
User avatar
Chopium
Senior Member
Senior Member
 
Joined: Sun Apr 12, 2009 1:52 am
Location: Illinois

Re:

Postby whiffen on Tue Jun 16, 2009 7:25 am

Mattc0m wrote:Excellent tutorial, I found the sprite idea (having multiple sprites per light source) a very good idea.

I have a question, however. Is there a difference between adding .vmt or .spr? Will it achieve the same effect?

Also, another question. Is "world space glow" the best render mode, or is there others that useful? Which ones should I consider using / what are the differences between them?

Thanks!


There shouldn't be any difference between .vmt and .spr.

Render mode: normal

This is just the default rendering

Render mode: texture

Plain opacity. Just the plain texture and no transparency.

Render mode: glow

Sprite is always the same size on your screen. No matter how close or far the size doesn't change.

Render mode: world space glow

Sprites size is relative to the world. Smaller when further away, larger when closer.

Render mode: dont render

Speaks for itself

The other rendering modes I'm not to sure about. Additive is something along the lines of blending in whatever color is behind it.
Image
User avatar
whiffen
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon May 12, 2008 3:49 pm

Re: Advanced Lighting

Postby v0rt3x on Mon Apr 04, 2011 12:48 pm

Heya - I've recently used this tutorial to create some awesome lights!

However I'd like to point out that in my opinion - adding 5 env_sprites (instead of 3) - equally spaced along the light source (for the model used in the tutorial) - creates a much nicer (perhaps even more realistic) look.

:)
User avatar
v0rt3x
Regular
Regular
 
Joined: Tue Feb 16, 2010 11:01 am
Location: Dublin, Ireland

Re: Advanced Lighting

Postby Gary on Mon Apr 04, 2011 8:36 pm

I often use 4 or so sprites for my florescent lights as well. I wonder how expensive sprites are...
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Advanced Lighting

Postby cpl. punishment on Tue Apr 05, 2011 4:38 am

Not very, I think.
cpl. punishment
Been Here A While
Been Here A While
 
Joined: Thu Oct 04, 2007 10:48 pm
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users

cron