WiseDarkness: Darkness
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
- A map with no lights, and no leaks, will be fullbright.
- Light entities, light and
light_spot
, have a Brightness property where in this example “255 255 255 200” 200 is the brightness. - The
light_environment
entity sets the color and angle of the light from the sun and sky. When used with a skybox.
In the example file for this project I’ve created a series of rooms that show how to create ambient effects and pitch black effects. In the image below I’ve applied the texture tools/toolsblack
. The other walls in the same room will react to light and cast shadows, you can use your flashlight in the game to light up the textured side of this same room but even your flashlight will not illuminate the tools/toolsblack
side of the room, it will remain pitch black.
In the opening leading to the open skybox area I’ve placed a normal light
entity and have used these settings for it:
- Brightness: 254 216 146 8
- Appearance: Normal
- Maximum Distance: 0
I have also placed an env_cubemap
in that area because as you know they are needed for proper transition of light. The area shown below needs proper transition of light.
buildcubemaps
console command when the map loads for the first time.
In the image below you can see that I’ve created a skybox over half of this map and I’ve created a small skybox around an opening in the wall for a prop gate.
To create the outdoor light for this project I’ve placed a light_environment
with these settings:
- Pitch Yaw Roll: -42 59 0 (Pointing down, use the “Point At” button.)
- Brightness: 175 230 239 50
- Ambient: 43 45 57 5
I’ve also changed the Map properties Skybox Texture Name to sky_day01_09
. To view the available skybox textures use the texture browser with the keyword skybox. As you will notice many of the textures end with bk, dn, etc. When you type in the name for the skybox textures you want to only include the name, as in sky_day01_09
rather than sky_day01_09dn
.