Snarkpit Articles


This is meant as a beginner?s introduction to lighting in the HL2 engine. If you have never used hammer before, and want the basics laid out for you, read on. First I will cover the basic entities and their settings, followed by a quick rundown on some of the cool effects you can create with a smattering of other entities. I am assuming that you already know how to create entities, edit their properties, and know the difference between point entities and brush entities.

The three basic lighting entities are the light, light_environment and light_spot. The three of these combined will do almost everything you will ever need. They are all point entities, and so are visible in the ?entity list? when the ?entity tool? is selected. Note that the light_dynamic entity is not covered in this tutorial.



The light entity is the simplest of the three. It defines a point in space from which light shines in all directions. Its settings are fairly self-explanatory. The most useful options to be had in the properties dialogue for this entity are ?brightness?, ?name?, and ?appearance?. The brightness field allows you to specify both the intensity and color of the light. The name field (duh) gives it a name so that it can be turned on and off by other entities. The appearance field allows you to choose a custom dynamic. As far as I am aware, all of the available options simply vary the intensity of the light with time. In general this setting is not very useful as the flickers you can create with it can be quite annoying.




The ?light_spot? entity defines a point from which a directed beam of light emanates. This entity is great for creating dramatic pools of light underneath lamps. It has all the same settings as the simple ?light? entity, plus a few more which are, again, self-explanatory. Worthy of particular note is the ?entity to point at? field. This allows you to specify a target for the light_spot. In this way you can easily direct its beam at odd angles which might be otherwise difficult to achieve. Simply place an ?info_target? where you want the light to shine, name it, and add that name to the ?point at? field. You should also consider setting the falloff to ?linear? rather than ?quadratic? this creates a much brighter more dramatic light because the intensity of the light falls off much more slowly with distance. As you can see, a cone emanates from the light_spot in Hammer. This gives you a good idea of where the cone of light will be projected in?game.




The light_environment entity is used to light outdoor areas. Only one needs to be placed in the entire map. It?s properties are used to define the properties of the sunlight/moonlight in your map. The ?ambient? field provides a way to specify how much scattered ?skylight? there is.




Now, you?ll notice in the screen above that these lights don?t look very good in game. There is no source, no bright beam of light that you can see shimmering in the air, and no lazily floating dust particles. All of these things are required for a good looking map. Any significant detail is beyond the scope of this tutorial, but here is a list of useful entities for spicing up your lighting, and a few words on their uses to get you started.

prop_static:
This is a point entity that enables you to place a model in the world. Use it to put in the light fixture of your choice.

point_spotlight:
This is a point entity that creates that cool ?light beam? effect that you may have admired in the single player game.

env_lightglow:
This is a point entity that creates a halo effect around a light and makes it look bright, and just generally cool.

func_dustmotes:
This is a brush entity that is used to create the cool floating dust particles you may have seen in de_dust.


Post ReplyView Topic
Discussion
[author]
Posted by Tracer Bullet on Tue Feb 22nd 2005 at 5:37am

Env_glow works just fine for normal lights. You just have to fiddle with the settings to get it right.
0 starsPosted by greensinge on Mon Feb 21st 2005 at 10:56pm

Very useful, thanks. Make more tutorials.
0 starsPosted by Ladybulf on Fri Jan 21st 2005 at 10:12pm

What im struggling to do is have the light come from a striplight, this is good basic knowledge
0 starsPosted by DrGlass on Wed Jan 12th 2005 at 5:12am

Env_lightglow dosn't work as a glow for lights, that is used for the effect seen in the coast level as you exit the tunnles. It glows from far away but once you get close it will fade out. Use env_sprite, set to 'glow' and change the scale as you need.
[author]
Posted by Tracer Bullet on Mon Jan 10th 2005 at 7:37am

Func_dustmote is a brush based entity. You need to create a brush in the shape of the dustmote you want, and then tie it to the func_dustmote entity. You will not find this entity in the point entity list.
0 starsPosted by ORGY on Mon Jan 10th 2005 at 3:58am

Hey i have one problem with this tutorial. It say on there in order to get the dust floating in the light you need to use the func_dustmotes entity.....BUT it is no where to be found in my list of entities. maybe it's just me or maybe not but if anyone knows anyway to get in besides using the func_dustmotes entity please tell me, it's just really not listed for me smiley.
0 starsPosted by Random on Fri Dec 31st 2004 at 1:40am

Very helpful thanks
0 starsPosted by Anthony on Mon Dec 27th 2004 at 9:32am

I think a bit of a focus on using the point_spotlight in conjuction with the light_spot might be in order...
I've only seen one tutorial on how to achieve the effect (and it's very poorly done). I've messed around with it but I can't seem to get the really nice beam happening.
Still, nice tutorial all in all.
0 starsPosted by Andrei on Thu Dec 23rd 2004 at 10:54am

Well, you SHOULD make a tutorial covering the light_dynamic aswell. However, this is a very good tut for n00...erm, newcomers smiley .
0 starsPosted by SaintGreg on Wed Dec 22nd 2004 at 3:28am

Good for noobs like me smiley Like he said, whether its you or not it would be good for someone to go over more advanced lighting techniques
Post ReplyView Topic