Colormap , Pallete

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Colormap , Pallete

Post by Cobalt »

Ok so colormap.lmp is the colormap file for the player models, and pallete.lmp is the one for the 2d graphics systems?

I notice in DP engine, the file is called: colormap_palette.lmp ?

I guess in vanilla Q, you cant point models to their own colormaps, but is this possible in other engines?

Finally, I notice some QW skins I found and am using in DP for the player model using the _.mdl.png naming scheme seem to ignore the colormap. So I guess skins can be made with their own internal colormap
or do they have them hard coded in somehow?
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: Colormap , Pallete

Post by qbism »

Original Quake graphics (HUD, skins, map textures, everything) all share a single 256 color palette. That's palette.lmp. Colormap.lmp is a precomputed color table used by the software engine for shading.

Hardware-rendered engine replacement textures like png or tga don't use the palette. Unless the engine has an option to remap colors to the palette.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Colormap , Pallete

Post by Spike »

gl engines don't use palette.lmp for actual rendering, its instead used only at load time.
this means they can't use the colourmap at all. they instead make assumptions about fullbrights and overbrights. the result is fairly close, but not identical.
colourmapping player skins can be emulated with basetex+toptex*topcolour+bottomtex*bottomcolour, which is only a 12-fold increase in memory usage compared to software rendering... :P

I know of only two engines that utilise the colourmap in opengl. one of them is my own, but it only uses it for regular world surfaces at this time. this results in banding of course, so its only desirable for people who prefer ultra faithful rendering. for anyone else its a bit more ugly.

3dfx cards used to support paletted textures. other hardware does not, as it pretty much makes blending impossible.

I don't have a clue what your 'colormap_palette.lmp' file is for, I've never heard of any such filename.
quake2 doesn't support lmp, but it does have a colormap.pcx file, the image data itself provides the colormap, while the pcx palette provides the palette for everything else (at least non-pcx content). I doubt its relevant, but its a vaugely interesting sidenote.


QW skins are strictly .pcx for ease of editing. the palette is not used. they are strictly 8bit for software rendering compat. if you want to make these work with dp (when not pretending to be a qw client), you'll need to split the image into three different versions according to the formula I gave in my first paragraph of this post. the 'base' texture should have the shirt+pants areas masked to black. the _shirt texture should have the non-shirt areas black, while the _pants texture (as a brit, that term makes me laugh) should have all but the nether regions masked black. the shirt and pants textures should both be greyscale, so that the player's colours can tint it accordingly.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Colormap , Pallete

Post by Cobalt »

I stumbled on it in Lord Havocs Nexiuz pk3 file for DP.

colormap_palette.lmp and also a colormap_palette.pl (perl script?) are both in the gfx dir.

I dropped the lmp file in my mode gfx folder and the scoreboard and player skin colormaps are set by whats in that file. Not sure what the .pl file does.....
Spike wrote:I don't have a clue what your 'colormap_palette.lmp' file is for, I've never heard of any such filename.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Colormap , Pallete

Post by revelator »

probably a perl script to create custom color maps.
Productivity is a state of mind.
Post Reply