Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Editing Quake palette

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
[[Image:Qpalette.png|right|thumb|The Quake palette.]]
+
__NOTOC__[[Image:Qpalette.png|right|thumb|The Quake palette.]]
Color 255 is transparent for sprites, 2d lmps, and gfx.wad entries (excluding [[conchars]], in which case it is black (color 0) that's made transparent). It is important that palette index 0 is black. The parameters for the [[color]] console command are the row #, but is restricted to rows 0 - 13.
 
 
 
It is important that the latter 8 palette rows are "backwards" (light-to-dark instead of dark-to-light). It appears that the [[id Software|ID]] artists did this for no good reason in the original Quake palette, and the engine programmers were forced to add a hack to accommodate it (along with the comment "the artists made some backwards ranges. sigh"). The only area this affects is player shirt/pants color translation (where one palette row must be mapped to another).
 
 
 
 
 
 
{|style="color:white;font-weight:bold;font-size:8pt;text-align:center;" cellspacing="0" cellpadding="2"
 
{|style="color:white;font-weight:bold;font-size:8pt;text-align:center;" cellspacing="0" cellpadding="2"
 
|-
 
|-
Line 23: Line 18:
 
|style="background:#cbcbcb;height:8pt;"|13
 
|style="background:#cbcbcb;height:8pt;"|13
 
|style="background:#dbdbdb;height:8pt;"|14
 
|style="background:#dbdbdb;height:8pt;"|14
|style="background:#ebebeb;height:8pt;color:black;"|15
+
|style="background:#ebebeb;height:8pt;"|15
 
|-
 
|-
 
|style="color:black;text-align:right;"|Brown (1)
 
|style="color:black;text-align:right;"|Brown (1)
Line 131: Line 126:
 
|style="background:#dfab27;height:8pt;"|109
 
|style="background:#dfab27;height:8pt;"|109
 
|style="background:#efcb1f;height:8pt;"|110
 
|style="background:#efcb1f;height:8pt;"|110
|style="background:#fff31b;height:8pt;color:black;"|111
+
|style="background:#fff31b;height:8pt;"|111
 
|-
 
|-
 
|style="color:black;text-align:right;"|Peach (7)
 
|style="color:black;text-align:right;"|Peach (7)
Line 224: Line 219:
 
|-
 
|-
 
|style="color:black;text-align:right;"|Yellow (12)
 
|style="color:black;text-align:right;"|Yellow (12)
|style="background:#fff31b;height:8pt;color:black;"|192
+
|style="background:#fff31b;height:8pt;"|192
|style="background:#efdf17;height:8pt;color:black;"|193
+
|style="background:#efdf17;height:8pt;"|193
 
|style="background:#dbcb13;height:8pt;"|194
 
|style="background:#dbcb13;height:8pt;"|194
 
|style="background:#cbb70f;height:8pt;"|195
 
|style="background:#cbb70f;height:8pt;"|195
Line 275: Line 270:
 
|style="background:#e7ab5f;height:8pt;"|237
 
|style="background:#e7ab5f;height:8pt;"|237
 
|style="background:#efbf77;height:8pt;"|238
 
|style="background:#efbf77;height:8pt;"|238
|style="background:#f7d38b;height:8pt;color:black;"|239
+
|style="background:#f7d38b;height:8pt;"|239
 
|-
 
|-
 
|style="color:black;text-align:right;"|Brights (15)
 
|style="color:black;text-align:right;"|Brights (15)
Line 281: Line 276:
 
|style="background:#b79b37;height:8pt;"|241
 
|style="background:#b79b37;height:8pt;"|241
 
|style="background:#c7c337;height:8pt;"|242
 
|style="background:#c7c337;height:8pt;"|242
|style="background:#e7e357;height:8pt;color:black;"|243
+
|style="background:#e7e357;height:8pt;"|243
|style="background:#7fbfff;height:8pt;color:black;"|244
+
|style="background:#7fbfff;height:8pt;"|244
|style="background:#abe7ff;height:8pt;color:black;"|245
+
|style="background:#abe7ff;height:8pt;"|245
|style="background:#d7ffff;height:8pt;color:black;"|246
+
|style="background:#d7ffff;height:8pt;"|246
 
|style="background:#670000;height:8pt;"|247
 
|style="background:#670000;height:8pt;"|247
 
|style="background:#8b0000;height:8pt;"|248
 
|style="background:#8b0000;height:8pt;"|248
Line 290: Line 285:
 
|style="background:#d70000;height:8pt;"|250
 
|style="background:#d70000;height:8pt;"|250
 
|style="background:#ff0000;height:8pt;"|251
 
|style="background:#ff0000;height:8pt;"|251
|style="background:#fff393;height:8pt;color:black;"|252
+
|style="background:#fff393;height:8pt;"|252
|style="background:#fff7c7;height:8pt;color:black;"|253
+
|style="background:#fff7c7;height:8pt;"|253
|style="background:#ffffff;height:8pt;color:black;"|254
+
|style="background:#ffffff;height:8pt;"|254
 
|style="background:#9f5b53;height:8pt;"|255
 
|style="background:#9f5b53;height:8pt;"|255
 
|-
 
|-
 
|}
 
|}
  
 
+
Color 255 is transparent for sprites, 2d lmps, and gfx.wad entries (excluding [[conchars]], in which case it is black (color 0) that's made transparent). It is important that palette index 0 is black. The parameters for the [[color]] console command are the row #, but is restricted to rows 0 - 13.
  
 
=== palette.lmp ===
 
=== palette.lmp ===
The palette is stored in gfx/palette.lmp. It consists of 256 RGB values using one byte per component, coming out to 768 bytes in total.
+
The palette is stored in gfx/palette.lmp. It consists of 256 RGB values, coming out to 768 bytes in total.
  
 
=== Download ===
 
=== Download ===
* [[Image:quake_palette.zip]] - The Quake palette in following formats: .aco, .act, .ase, .pal and the original palette.lmp (raw lump of RGB values, 768-bytes). Also has a plaintext hex matrix and a .png preview.
+
* [[Image:quake_palette.zip]] - The Quake palette in 3 formats: JASC (text), Microsoft (RIFF), and raw (768-byte lump of RGB values).
  
 
== Colormap ==
 
== Colormap ==
 
[[Image:Colormap.png|right|thumb|The Quake colormap.]]
 
[[Image:Colormap.png|right|thumb|The Quake colormap.]]
  
The colormap is a table used for lighting in software Quake engines. It contains a column of 64 values for each palette color. Each value is an index into the palette representing as closely as possible the original color brightened or darkened: shade 0 is double bright, shade 32 is the original color, and shade 63 is black.
+
The colormap is a table used for lighting in software Quake engines. It contains a column of 64 values per each palette color. Each value is an index into the palette representing as closely as possible the original color brightened or darkened: shade 0 is double bright, shade 32 is the original color, and shade 63 is black.
  
 
"Fullbright" colors are those which are not lit in the colormap, simply using the original color for all 64 shades. These colors, when used in textures and model skins, will not be affected by lighting. Fullbrights are used for things like fire and glowing lights. In Quake these are the last 32 colors in the palette.
 
"Fullbright" colors are those which are not lit in the colormap, simply using the original color for all 64 shades. These colors, when used in textures and model skins, will not be affected by lighting. Fullbrights are used for things like fire and glowing lights. In Quake these are the last 32 colors in the palette.
Line 318: Line 313:
  
 
=== Generating the colormap ===
 
=== Generating the colormap ===
The following C code will generate a colormap.lmp that is nearly (but not exactly) identical to the Quake colormap. Written by [[metlslime]] who placed it in the public domain.
+
The following C code will generate a colormap.lmp that is nearly (but not exactly) identical to the Quake colormap. Sorry about the lack of comments, maybe I'll add some later. Consider it public domain.
  
 
  /* sample a 24-bit RGB value to one of the colours on the existing 8-bit palette */
 
  /* sample a 24-bit RGB value to one of the colours on the existing 8-bit palette */
Line 380: Line 375:
  
 
== Legal status ==
 
== Legal status ==
John Carmack officially put palette.lmp in the public domain{{citation needed}} to make Quake ports easier, so it is legal to, for example, embed it right into an engine executable. Colormap.lmp can also be considered public domain as it is trivially derived from the palette.
+
John Carmack officially put palette.lmp in the public domain to make Quake ports easier, so it is legal to, for example, embed it right into an engine executable. Colormap.lmp can also be considered public domain as it is trivially derived from the palette.
 +
 
 +
== Related Info ==
 +
* Most engine mods use 32-bit colour, so you need not worry about palettes. With 32-bit textures, shirt/pants colour changing and fullbrights are only possible if engines support a new implementation of them, for example [[DarkPlaces]]'s [[DP_GFX_EXTERNALTEXTURES]] extension, which allows additional _glow, _pants, _shirt, etc textures on top of the main one)

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Template used on this page: