lightmap Last edited 1 month ago2024-02-14 11:00:08 UTC

A lightmap is the lighting data associated surfaces in a map. In general, there is 1 point of lighting data (luxel) for every 16 texture pixels (texels) on any particular surface, in both dimensions. The engine interpolates the brightness value between each of the points to give it the smooth lighting effect. For how the size is calculated, see: AllocBlock.

The compile tool HLRAD produces the lightmaps for the map. Lighting can come from either light entities or from texture lighting.

There can be up to 4 different lightmaps applied to a face. Usually all unnamed static lights get baked into the first, then named (i.e. switchable) and animated lighting go to the next ones, but only up to the fourth. The assignment is through the style number: all unnamed static lights are style 0 (normal) lightmap, flourescent flickering lights are style 10 lightmap, and named lights are given style numbers 32 through 62. The style numbers are read from light entities, and for named lights the style numbers are assigned to them at compile time.

For a variety of reasons, the engine uses the AllocBlocks as a place to paint the resulting product of all lighting values, which is then combined with the texture data (and, if available, detail textures). Important to note is that there is a hard limit for AllocBlocks; each is 128x128 luxels, for a maximum of 64 such blocks.

Comments

You must log in to post a comment. You can login or register a new account.