Lightmap
(→Lightmap resolution) |
m (→Usage of lightmaps) |
||
(23 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{grammar}} |
− | + | ||
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]] | [[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]] | ||
− | Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture | + | Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used). |
− | + | ||
− | Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In | + | |
==Lightmap resolution== | ==Lightmap resolution== | ||
− | Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory | + | Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution: |
* Global luxel scale (set in [[map build script]]) | * Global luxel scale (set in [[map build script]]) | ||
Line 18: | Line 15: | ||
==Deluxemapping== | ==Deluxemapping== | ||
− | + | Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting. | |
+ | |||
+ | ==Lightmap types== | ||
+ | There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lm_<num>). | ||
+ | |||
+ | [[map build script|Map build script]] are used to configure whether map should use internal or external lightmaps. | ||
+ | |||
+ | External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. | ||
+ | |||
+ | There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit. | ||
+ | |||
+ | == Usage of lightmaps == | ||
+ | {| cellspacing=0 cellpadding=2 width=900 | ||
+ | | width:50% align=right | Small objects: | ||
+ | | width:50% | <font color=orange>Require high-resolution lightmaps or artifacts will occur</font> | ||
+ | |- | ||
+ | | align=right | Foliage (grass, mushrooms etc.): | ||
+ | | <font color=orange>Likely to overwhelm map size, as each object adds to lightmap data</font> | ||
+ | |- | ||
+ | | align=right | [[BModel | Brush models]]: | ||
+ | |<font color=green>OK</font> | ||
+ | |- | ||
+ | | align=right | Whole map: | ||
+ | | <font color=green>OK</font> | ||
+ | |- | ||
+ | | align=right | Terrain: | ||
+ | | <font color=green>OK</font> | ||
+ | |- | ||
+ | | align=right | [[Radiant/Glossary | Point entities]]: | ||
+ | | <font color=red>not applicable</font> | ||
+ | |} | ||
+ | |||
+ | ==Console variables== | ||
+ | {{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}} | ||
+ | {{cvar|r_fullbright|disables static lighting.}} | ||
==See also== | ==See also== | ||
+ | * [[Darkplaces lighting]] | ||
+ | * [[Vertex lighting]] | ||
* [[Lightgrid]] | * [[Lightgrid]] | ||
+ | [[Category:Darkplaces engine]] | ||
[[Category:Glossary]] | [[Category:Glossary]] | ||
+ | [[Category:Lighting]] | ||
+ | {{finished}} | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 22:10, 20 February 2013
Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Q3BSP, lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).
[edit] Lightmap resolution
Lightmap resolution is different from the texture resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:
- Global luxel scale (set in map build script)
- Entity's "_ls" or "_lightmapscale" field (works on func_group too)
- Material's q3map_lightmapSampleSize (alters default luxel size for this material)
Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).
[edit] Deluxemapping
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.
[edit] Lightmap types
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside BSP file. External lightmaps is 24-bit TGA images stored outside of BSP file (in map/bspfilename/lm_<num>).
Map build script are used to configure whether map should use internal or external lightmaps.
External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.
There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.
[edit] Usage of lightmaps
Small objects: | Require high-resolution lightmaps or artifacts will occur |
Foliage (grass, mushrooms etc.): | Likely to overwhelm map size, as each object adds to lightmap data |
Brush models: | OK |
Whole map: | OK |
Terrain: | OK |
Point entities: | not applicable |