Difference between revisions of "COLORMAP"

From DoomWiki.org

[checked revision][checked revision]
(Rewriting this one for that "ess ee oh" ranking thing. Also added the bit about SMMU being able to display multiple COLORMAP effects without being in the sector in question.)
m (+see also Carmack's typo)
Line 17: Line 17:
 
== See also ==
 
== See also ==
 
* [[PLAYPAL]]
 
* [[PLAYPAL]]
 +
* [[Carmack's typo]]
  
 
==Sources==
 
==Sources==

Revision as of 21:06, 8 July 2018

The colormap used in the Doom games.

The COLORMAP is a lump that the Doom engine uses to show sectors with different light levels, including any dynamic lighting effects, as well as any color changes that do not affect the status bar. It contains 34 maps that map colors decreasing in brightness within the PLAYPAL palette chosen at that time. Contrary to the name of the lump, no actual RGB values are defined - only the indexed location of the colors from the current PLAYPAL palette in use.

Each colormap is a table 256 bytes long. It is indexed using a pixel value (from 0 to 255) and yields a new, brightness-adjusted pixel value.

The first 32 colormaps (0-31) are used for sector brightness, with colormap 0 being the brightest and 31 darkest. During rendering, sprites, vertical slices of walls, and horizontal slices of flats are assigned a colormap based both on the sector they are in and the distance they are from the viewer. In addition, orthogonal walls have their colormaps modified by what direction they are facing, a concept dubbed "fake contrast". Colormap 6 is used to give a sprite partial invisibility by remapping pixels behind the object to darker shades of nearby pixels. This functionality is replaced by the TINTTAB lump in Heretic and Hexen.

The Doom engine uses multiple colormaps simultaneously. The light amplification visor is implemented by ignoring brightness values and using colormap 1 for all sectors, although the engine still displays the partial invisibility effects defined in colormap 6.

Colormap 32 is used when the player has the invulnerability powerup. The view window is painted in inverted greyscale, with all sector brightness levels disregarded. However, because of the invulnerability colormap bug, the sky is always painted using colormap 0 regardless of invulnerability.

Colormap 33, originally used in the Doom press release beta for invulnerability, is now all black. Previously, colormap 32 was used for the light amplification visor effect. Id Software decided to use colormap 0 for light amplification in the final release, resulting in fullbright sprites, and removed the green map, shuffling the invulnerability map to the previous place; but they forgot to change the total number of colormaps to generate in their dcolors.c utility.

Boom colormaps

Boom allows to use custom colormaps through the line type 242. These colormaps will be used instead of the normal COLORMAP for flats, walls, and sprites while the player's viewpoint is within the affected sector. Custom colormaps need to be used in a special namespace, delimited by C_START and C_END markers. Later Boom-derived source ports such as SMMU extended this functionality to show colormaps in sectors without the requirement of the player being in the affected sector.

See also

Sources