Difference between revisions of "Lightmap"
|Line 67:||Line 67:|
Revision as of 22:06, 17 March 2011
A lightmap is a generated texture applied additively to LightmappedGeneric brush faces to simulate lighting. The color values in the surface's albedo are multiplied by the color values in its lightmap.
The lightmap scale of a face defines the resolution of its lightmap. The default scale of 16 makes each lightmap pixel ("luxel") 16 units across, while a lightmap scale of 1 makes one luxel equal one unit. The Hammer Face Edit Dialog is used to change the value per-face.
Lowering 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).
When generating lightmaps, VRAD does not create penumbras. The effect can be simulated by increasing lightmap scale, however (which is why the relatively large value of 16 is the default).
Lightmap optimization can be done by eye with the aid of a compiled map: faces with low lighting contrast can have their scales increased, and vice versa faces with high contrast should be considered for lower scale. Just beware of setting a face's scale so high that it ends up a 'blob' of light that don't blend with its neighbors (use
mat_fullbright 2 to spot this).
Remember to take into account the size of a face, too. Moving a very large face even one point up or down can have a huge impact. Don't be afraid to split the face up if that helps, or to drop a bit of detail from huge floor or wall faces.
Clicking the camera control in the top-left of a 3D view in Hammer provides the option of "3D Lightmap Grid". This view textures each brush surface with a grid that represents its lightmap scale (shown in the last section).
Tool brushes are textured like any other in this mode, despite being invisible in-game, so switch them all off from their auto-visgroup.
The following are all cheats:
- Replaces all albedos with a grey tone, leaving just lighting information.
- Display luxels on all brush surfaces. Bug: Breaks on displacements
- Control whether luxels are smoothed together in the same way as texels.
- Doom mode! Averages lightmap values across each polygon.
- Unwraps each lightmap into a small, tessellating display in the top left of the screen. Not terribly useful to modders.
- To do: No apparent effect.
- To do: Unknown. Possibly a way of flushing lightmap data between map loads?