|
|
|
|
Tutorial Topics |
CS:GO SDK Adding Lights: How to Light Your First Room (Lighting Basics)February 12, 2013
|
|
|
|
|
In this tutorial you will learn: What happens when you do not insert any lights and run your map How to add a light Why are your prop models lit white and do not reflect correctly How to change your light color and appearance Weird bug in CS:GO with dotted light and shadow error and how to fix it Light source for every light |
It is time to illuminate our simple map. To do that we need to insert light entities and tweak their properties for color and light intensity. There are a few bugs and errors we need to address. I will also cover how to problem solve some common light issues.
MAT_FULLBRIGHT If you compile your map and run it in-game, Source will default your lighting to full bright. Once you insert a light into your map, the engine will switch full bright off and begin calculating your lighting. Console command for full bright are:
Mat_Fullbright is a useful command in Source. You can use it to gameplay test your map without worrying about setting up lights. Unfortunately right now, mat_fullbright is buggy and does not produce full bright map
HOW TO ADD A LIGHT There are various light entities in Source to light your map.
Some are used for lighting exteriors, other for interiors. To insert a basic light, that is often used for interiors. Enable the Entity Tool:
Select light in the drop down menu:
In perspective viewport, Left Mouse Click to insert a light.
CHANGING LIGHT COLOR AND APPEARANCE To change any properties for the light such as color or appearance, enable the Selection Tool and double click on the light bulb you just places to open its properties. Change the light color by selecting Brightness and clicking on Pick Color. Choose the color you want once the color wheel swatch comes up.
You will see 4 different values displayed in the input window above Pick Color. First 3 3-digit values are RGB colors. Last 3 digits is light intensity.
DUPLICATING LIGHTS Duplicating lights is the same as for duplicating brushes and prop models.
LIGHT SOURCE Every light must have a light source. Use a prop_static for a physical light such as lamps, light posts etc.
FULL BRIGHT PROP MODELS To fix the issue below, where your props are full bright and do not light or reflect correctly you need to insert env_cubemap entity.
To do this use the Entity Tool and select env_cubemap in the drop down menu. Left click in perspective viewport to place env_cubemap.
Left click in perspective viewport to place env_cubemap. Ideally you want to place env_cubemap near the models you want to reflect the type of environment that is around them. So you will eventually have many env_cubemaps. But for right now, placing just one, will fix the issue.
LIGHT APPEARANCE SETTING BUG/ERROR If you changed any light properties in the Appearance option, such as flicker, candle etc, you will get a weird dotted light and shadow issue when you compile and run your map. This is a bug in CS:GO as of right now. This maybe fixed in the future by Valve.
To avoid this, just keep Appearance to Normal.
|
|