Vlatitude: HL2 - Simple lights Last edited 1 year ago2022-09-29 07:56:13 UTC

Download example

This tutorial looks at simple light entitles for Half-Life 2, and assumes that you know some of the basics of Hammer. To get the most out of this tutorial, you should know how to: To start with, create the room that you want the light to be in. You can create a six sided block simply by creating a large brush and selecting 'Make Hollow', or you can build each surface individually. Once your done we are ready to put the light in.

The simplest way to do this is to create a brush and give it a light texture, then a light entity in front of it, but in this tutorial we will use a model to take full advantage of the detail offered by the Half-Life 2 engine.

First, insert the prop_static entity. As the light fixture won't be affected by any of the game's physics, you don't need to make it a prop_physics or anything more complicated.

Once you've got your prop_static, go into its properties and select 'World Model'
User posted image
Now click the 'browse' button and wait until the list of model folders in your hl directory loads. Surprisingly, the props_lights folder is empty, and the light models appear to be spread out over the props_wasteland and props_c17 folders. I've selected prison_cagedight001a in the props_wasteland folder. Now click the 'Apply' button and the red box that was your prop_static entity should change into your light fixture. Now position it in room, rotating if necessary. You should now have something that looks like this'
User posted image
Imagine trying to make that out of brushes! We've just saved ourselves about an hours work, not to mention the effect on gameplay all those brushes would have.

Now for the light source itself. Unfortunately, as good as the fixture looks, it won't actually emit any light. This is where the light entity comes in handy.

Inserted from the entity list, this basic light emitting entity works the same way as it did in hl1. Insert the light and position it very close to your light fixture model, like in the picture below. The default settings are a very bright, white light. You can change the brightness and colour to create different moods. To do this, select the brightness setting. The numbers displayed in the box should look like this: 255 255 255 200. The first 3 numbers are the colour in Red, Blue and Green, and the last number is the brightness. For this tutorial I've left the colour as white but changed the brightness back to 80.
User posted image
The light entity is now complete. If you compile you should have a room with a light fixture that emits light. But to make things look more realistic and detailed, we can add a glow to the light. Doing this is simple. Insert an env_sprite from the entity list and position it inside your light fixture. The env_sprite is already set up to glow, looks like valve anticipated us there! As you will see in hammer, the glow is shown but appears to have a black box around it. To fix it, open up the sprite's properties, and select 'Render mode'. Change it from normal to 'World Space Glow'. You may also want to change the 'Scale' and 'Size of Glow Proxy Geometry' as the default settings make the glow a bit small. I've used 1 and 4 respectively, but it will vary depending on what light fixture you used.

Apply the settings and compile again. You should now have something that looks like this:
User posted image
And that's just about it! There are ways of making more detailed lights such as the use of the light_spot or light_dynamic entities, but they will be covered later.
This article was originally published on 69th Vlatitude.
The original URL of the article was http://www.vlatitude.com/tutorials.php?tutID=62.
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.


You must log in to post a comment. You can login or register a new account.