Fr/Lightmap

From Valve Developer Community
< Fr
Revision as of 05:33, 10 November 2008 by Anarkia777 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A lightmap is the static lighting data for each Brush face. This light data is applied additively to each surface texture to produce the final lit effect. Especially common in BSP based engines, it's the method used for most lighting effects within the source engine.

Determined during the vrad compile process lightmaps are only applied to brush faces as models are lit differently.

Lightmap Scale

The lightmap scale determines how sharp or diffuse the static shadows will be on a particular facet. It is defined by the number of game units per lightmap pixel (luxel). The default value in Hammer is 16 units/luxel. Smaller values increase the sharpness of shadows, but mean more luxels, larger lightmap file size and slower compile times.

  • In Hammer, the "lightmap" viewmode shows the lightmap scale on all surfaces in the camera view. For individual surfaces, view and edit lightmap scale in the Face Edit Dialog.
  • Faces such as displacement maps calculate and use their own lightmap scale; different values will often get reset by Hammer to match the displacements' lightmap size.
A lightmap scale of 4
A lightmap scale of 16
A lightmap scale of 64
Tip.pngAstuce:A couple of things to bear in mind when configuring static shadow diffusion:
  • Generally, shadows will become more diffuse as they get further away from your average light bulb or flame. As these light sources are radial, the illuminated surface area is much smaller closer to the light. Thus increasing the lightmap density for these small, close areas is relatively cheap.
  • However, Direct light from the Sun or Moon (see light_environment) has negligible falloff and spread (ie parallel rather than radial rays) because these strong light sources are so far away. Direct parallel light will tend to cast equally sharp/diffuse shadows at any distance within a map.
  • Thicker Fog (see env_fog_controller) increases atmospheric scattering, which means all shadows will be be (a lot) more diffuse.

Related ConCommands