Lightmap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (typo & minor tidy)
No edit summary
Line 1: Line 1:
A lightmap is all the lighting data of each face. This light data is then applied additively to each face 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.
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. The lightmap's scale refers to the number of texture pixels per light pixel (luxel). Smaller values means more luxels, thus a better quality but larger BSP size and compile times. The lightmap resolution can be viewed within [[Hammer]] by altering the viewmode in the top right to lightmap. It can also be viewed and edited from the [[Hammer_Face_Edit_Dialog|Face Edit Dialog]] on any normal face. 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.
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 [[dimensions|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 [[Hammer_Face_Edit_Dialog|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.
 
[[image:intlight_lmap4.jpg|thumb|left|A lightmap scale of 4]]
[[image:intlight_lmap16.jpg|thumb|left|A lightmap scale of 16]]
[[image:intlight_lmap64.jpg|thumb|left|A lightmap scale of 64]]
{{clr}}
 
{{tip|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 a normal light source. As most light sources are radial, the illuminated surface area is much smaller closer to the light. Thus increasing the lightmap resolution 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 [[ConCommand]]s ==
== Related [[ConCommand]]s ==
Line 10: Line 25:
*[[Lightmap Commands#r_lightmap|r_lightmap]]
*[[Lightmap Commands#r_lightmap|r_lightmap]]


== Examples ==
 
[[image:intlight_lmap4.jpg|thumb|left|A lightmap scale of 4]]
[[image:intlight_lmap16.jpg|thumb|left|A lightmap scale of 16]]
[[image:intlight_lmap64.jpg|thumb|left|A lightmap scale of 64]]




[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 08:39, 15 April 2008

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.pngTip: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 a normal light source. As most light sources are radial, the illuminated surface area is much smaller closer to the light. Thus increasing the lightmap resolution 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