|Abstract Mapping series Discuss your thoughts - Help us develop the articles or ideas you want|
Ammunition | Animals & Creatures | Antlions | Beams & Lasers | Cables & Ropes | Clouds & Sky | Color Theory | Combat | Combine | Doors | Dust, Fog & Smoke | Elevators | Level Transitions | Environmental Lighting & Weather | Explosions | Fire | Foliage | Glass | Headcrab | Health | Ladders | Lighting | Optimization | Physics | Retinal scanners | Sound & Music | Special effects | Terrain | Trains | Turrets | Water | Weapons | Zombie
Lighting refers to all systems in Source which light up a level to make it look realistic. There are many areas of knowledge about lighting that a source level designer should know, most of which are accessible through this page.
- Adding Light - A beginners tutorial on how to set up a basic light entity.
- Intermediate Lighting - A tutorial dealing with all the light sources in more detail.
- Advanced Lighting - Additional information about lighting.
- Constant-Linear-Quadratic Falloff - An easy-to-read explanation of the old C-L-Q light attenuation system.
- HDR - High Dynamic Range Lighting.
Static light sources
- A static, omni-directional point light source. (e.g. a naked light bulb or flame.)
- A static, uni-directional point light source. (e.g. a torch or flashlight) The conical beam angle cannot exceed 90°.
- Provides two linked light sources:
- A diffuse 'ambient' light (representing reflected light from clouds and the atmosphere in general) that emits from all skybox surfaces
- A directional 'brightness' light (representing sunlight or moonlight) that is only cast in a single direction.
- Both are emitted from the toolsskybox material wherever it is used on a map. See also Skybox.
- Illuminates particles produced by env_smokestack. Particles are not affected by normal lighting. Use (no more than) two of these to make (only) env_smokestack particles appear to reflect ambient lighting.
- Glowing Textures
- Brush surfaces with a light-emitting material (as defined in
game_dir/lights.rad) applied will cast volumetric light in a 180° cone.
Static light receivers
- This Hammer Face Edit Dialog tool 'Lightmap Scale' can be used to control how sharp or diffuse the lightmap of a brush surface will be - an effect most noticeable between areas of high contrast, e.g. shadows. Note that while adding extra light sources will not significantly affect performance, decreasing lightmap scale (i.e. increasing resolution) will more directly increase map file size and memory usage.
- Unlike other model entities, prop_static are lit statically: a lighting value is stored for every vertex, and the model's collision mesh (or, optionally, reference mesh) is used to calculate lightmap shadows.
- There are the following options:
disableshadows- Do not cast lightmap shadows
disablevertexlighting- Only store a single lighting value for the entire model
disableselfshadowing- Prevents the entity from casting shadows on itself
ignorenormals- Ignores normals of vertex data to calculate lighting. This is extremely useful for foliage, and other thin types of vertex meshes.
Dynamic light sources
- A simple, uni-directional dynamic light that can be moved, turned, and adjusted.
- A dynamic spotlight beam effect, with an optional dynamic light source where it hits a surface.
- A spotlight NPC, similar to point_spotlight but with the capability of tracking targets.
- A dynamic light that lights with a texture rather than a solid colour, and which also 'subtracts' realistic dynamic shadows. Affects all surfaces that can accept lighting, and is used for the player flashlight in Episode Two.
Warning: In Left 4 Dead, Portal 2 and Alien Swarm, the direction of a shadow is calculated on a per-entity basis, and dictated by the closest light to the entity. But not in Source2006/2007/2013 mods, unless you apply Dynamic RTT shadow angles in Source 2007 to your mod.
Warning: Dynamic Shadows can sometimes project through walls and floors, giving away the location of players or objects. Use info_no_dynamic_shadow to workaround this problem if you encounter it.
- Point entity used to control Dynamic Shadow projections for the entire map, including maximum distance cast, direction cast, and sharpness/diffuseness.
- Point entity used to list Brush surfaces that should not receive Dynamic Shadows.
- prop_physics entities
- have a "shadowcastdist" keyvalue to override how far this object casts Dynamic Shadows.
- prop_dynamic entities
- have a "disableshadows" keyvalue, and "enableshadows" and "disableshadows" inputs to control Dynamic Shadows cast by them.
- NPC entities
- have the prop_dynamic shadow controls, plus a "disablereceiveshadows" To do: to prevent...?
Tyndall effects are caused by light scattering on suspended (colloid) particles in a transparent medium. E.g., car headlights in fog.
- Halo (Glow Sprite) effects :
- Lightbeam (Volumetric Light) effects :
- Brush texture :
- Brush texture :
- Model :
models/Effects/vol_light.mdl- use with prop_static.
- Brush texture :
- Naming a light makes it more expensive. Only name lights when you need to. Multiple lights sharing the same name are cheaper than lights with separate names.
- light_dynamic is especially expensive, and will not even show up on some systems
- The basic light entities do not come with a visible representation (e.g. a lightbulb). For that you need a prop. See HL2 light props for a list.
- The basic light entities do not come with a "glow" as you'd expect to see in a foggy or misty area. To provide this, either compile and run the map with HDR enabled, or add a point_spotlight (with dynamic lighting off unless needed) or env_sprite entity.
- Maps will not be lit unless you run vrad (or equivalent). Vrad will not run properly and will not calculate realistic light bounces unless the level is free of leaks.
- Several textures provide their own light & can do so using
lights.radin a mod's directory or the one in
- Moving brushed-based objects will not change the way they are lit. Their lighting will be calculated only according to their positions in Hammer. (e.g. a brush in a dark room will not become bright if it is brought into a bright room.)
- Light can be reflected off surfaces during compile, indirectly illuminating the environment around them. See $reflectivity
0is normal lighting.
1is 'full bright' lighting, where everything is 100% lit.
2has been introduced with the Orange Box and is 'lighting only'. It replaces all textures' images with a colourless monotone, allowing you to see exactly what is lit, where, and probably how.
- HL2 light props
- Color theory (level design)
- Light entities - A list of light entities.
- Intermediate Lighting
- Advanced Lighting
- Window lighting - How to simulate refracted sunlight through openings.
- Understanding and Using Lightmaps (Archived version retrieved on 26 August, 2007)
- Volumetric Lighting (Archived version retrieved on 24 August, 2007)
- Lighting Tutorial - Covers entities & variables with examples (Archived version retrieved on 6 September, 2016)
- Quadratic/Linear/Constant in Lights (Archived version retrieved on 24 November, 2010)
- HDR/Shaped Light/Burning Light/Darkness/Sun/Volumetric (Archived version retrieved on 20 January, 2008)