Emphasizing lights

We all know that light doesn't radiate without a source. Lights in your map should have a place of origin. Thankfully, there's a collection of models available to use as light sources. Let's start with a simple point light source.

Placing point light sources

This is a concrete hallway with a simple point light in the middle of it. The light comes from nowhere, and the overall effect is boring and unrealistic. Let's put some light fixtures in the hallway to add some realism.

Placing point light sources

Add a prop_static entity using the light_cagelight02_on.mdl model to the map, and align it to the wall, as shown in the following image. Make sure to choose the correct skin entity for the light, as some light models can have an on skin and an off skin. Move the light entity a few units out in front of the model and reduce the brightness parameter to 80.

Placing point light sources

Give the map a quick test-compile to check the results. If the lighting on the model is looking a bit off, set the disable shadows property in the prop_static entity to yes to clean up the results.

Placing point light sources

Even though the map is darker, and the lighting isn't perfect, you still get the idea that the light is being emitted from the cage light model mounted on the wall.

We can even add a bit more realism by using a glowing effect that will fade as the player approaches the light. Place an env_sprite point entity inside the light model. In this case, the only two parameters we need to change are the render mode parameter and the Size of Glow Proxy Geometry parameter. Change render mode to glow so that the sprite scales it relative to our position, and change the Size of Glow Proxy Geometry parameter to 5 to make sure the sprite will render properly when the origin is inside a model. Give the map another compile to check out your results.

Placing point light sources

Placing spot light sources

Spot lights can also use a model and glow effect to increase their realism. A fluorescent light model can benefit from an entity called env_lightglow. The env_lightglow entity allows you to specify the width and height of a glow effect as well as the distances they start to fade at. The settings are set just like a regular sprite entity.

Placing spot light sources
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.187.62