
New Polymer feature: highpalookup maps "A new system to replace polymost tinting and most alternate pal maps"
#121 Posted 28 February 2011 - 01:15 PM
#122 Posted 28 February 2011 - 01:20 PM
#123 Posted 28 February 2011 - 01:50 PM
Helixhorned, on Mar 1 2011, 12:15 AM, said:
Oh, I've overlooked that you were talking about the gray part of the texture. Actually it's a highpal fault. In the previous versions of my highpalookups this artifact was even more pronounced, so I was looking for a way to reduce it, but dark grays still get affected by that blue-to-yellow conversion. A bit of manual editing on hipal #23 might help, but it's better to continue modifying my highpal generating algorithm to increase its "stiffness" on dark colors.
#124 Posted 07 March 2011 - 02:24 PM
#125 Posted 07 March 2011 - 02:28 PM
#126 Posted 07 March 2011 - 02:35 PM
Plagman, on Mar 7 2011, 05:28 PM, said:
It would have to be able to be applied to the glowmap without being applied to the base texture. The idea is to create a lot of interesting blinking light patterns without having to load up the folder with a bunch of extra texture files.
#127 Posted 05 January 2013 - 11:00 AM
Number of downloads: 103
#128 Posted 05 January 2013 - 03:36 PM
Drek, on 05 January 2013 - 11:00 AM, said:

Nice to see the script getting some more use. The wisest way to prepare the lookups is to load raw data into a graphic editor supporting raw format.
The lookup data is, not surprisingly, stored in the LOOKUP.DAT file. So let's look into its format (quoted from the ExtCLUT readme but works for all Build palettes):
LOOKUP.DAT:
Address range Description Size
0x0000 Number of pals [0x0001]
0x0001 - 0x8080 Palettes (first byte is the mapped ID, up to 127) [0x0101 * byteptr(0x0000)]
0x8081 - 0x8380 Underwater palette (BGR 0-63) [0x0300]
0x8381 - 0x8680 Night vision palette (BGR 0-63) [0x0300]
0x8681 - 0x8980 Duke3D logo palette (BGR 0-63) [0x0300]
0x8981 - 0x8C80 3DRealms logo palette (BGR 0-63) [0x0300]
0x8C81 - 0x8F80 Episode 1 Seq palette (BGR 0-63) [0x0300]
We'll need to extract the lookup palettes which are in the beginning right after the first byte, but each lookup is preceded by a byte denoting which pal the game should setup. So there are 257 bytes stored per palette. Knowing how many palettes is contained in the file, we can rename LOOKUP.DAT into LOOKUP.RAW and open it as a grayscale (8-bit) 257x*** image, having the height equal to the number of palettes. Don't forget to set the header size to 1 byte, since we have to omit the first byte. Now the leftmost column of the image will keep mapped pal IDs (no correct colors will be seen at this step), with each row of pixels corresponding to a specific palette, so we can rearrange them in ascending order or simply crop the image to remove the extra column and leave 256 colors. Resave the image into another RAW file and reopen it with a width of 16 pixels and a height 16 times the number of palettes (each pal is interpreted by my script as a 16x16 block). The image is still grayscale, but you should be able to apply any palette to it (possibly, extract it from a screenshot if you don't have one you need), of course with the 'maintain indexes' option selected. That's all, good luck.
#129 Posted 05 January 2013 - 04:36 PM
Once again thanks for the info, I will try your way too, if only as an exercise in CG. The .RAW format is new to me and sounds interesting.
Actually here it is:

This post has been edited by Drek: 05 January 2013 - 04:47 PM
#130 Posted 06 January 2013 - 11:10 AM
@Craigfatman; I'm thinking of making a nice little tut for the wiki and was wondering if I can i) include your script unchanged from this thread or ii) link to it
This post has been edited by Drek: 06 January 2013 - 12:21 PM
#131 Posted 06 January 2013 - 01:41 PM
Drek, on 06 January 2013 - 11:10 AM, said:
@Craigfatman; I'm thinking of making a nice little tut for the wiki and was wondering if I can i) include your script unchanged from this thread or ii) link to it
As for the tutorial, it would be really nice to have. Also I should state that the script is free for distribution and modification.
#132 Posted 08 January 2013 - 07:23 AM
The making of: Highpal Lookup Tables

Number of downloads: 7863
#133 Posted 08 January 2013 - 06:15 PM
Drek, on 08 January 2013 - 07:23 AM, said:
Nice one, Drek. Quite detailed and intelligible, that's how a good tutorial should look. But there are several things to note. Did you know that this script has a TGA output feature? That is, when you go into that output mode by pressing the space bar, then if you hit F6 and save a TGA file, there will be your highpal ready to use. So you don't actually need to make any screenshots. I apologize if it wasn't clear enough, but you might have overlooked this function.
Otherwise, I'll link to your tutorial on my page about CLUT Stat when I finally get to writing it =P
This post has been edited by CraigFatman: 08 January 2013 - 06:16 PM
#134 Posted 12 April 2013 - 04:42 AM
So far, what I can say about size is that the difference in size is not that spectacular. We are talking about maybe 30-40 megs. However, it could be that loading times decrease a bit, I need to check that out.
What I would like to know:
Are these custom tile skins/textures still needed at all, e.g. for Polymost, or would no one mind if they got removed completely? I still have to look at the results, i.e. how the highpal maps are doing in comparison, but if they are not totally off regarding colors and if it gains a noticable advantage, I guess some cleanup work in the repository would make sense.
If Polymost still requires them, maybe it could at least make sense to remove the extra pals from the Polymer dirs (and defs) and move them to Polymost subdirs/defs instead, for easier "isolation" in case you want to have a Polymer-only pack.
(Since I don't know how far this feature has progressed since its introduction and considering no one has tried to do this step until now, I hope that no one minds my minor bump of this thread.)
This post has been edited by NightFright: 12 April 2013 - 04:56 AM
#135 Posted 12 April 2013 - 09:00 AM
#136 Posted 12 April 2013 - 10:18 AM
NightFright, on 12 April 2013 - 04:42 AM, said:
So far, what I can say about size is that the difference in size is not that spectacular. We are talking about maybe 30-40 megs. However, it could be that loading times decrease a bit, I need to check that out.
What I would like to know:
Are these custom tile skins/textures still needed at all, e.g. for Polymost, or would no one mind if they got removed completely? I still have to look at the results, i.e. how the highpal maps are doing in comparison, but if they are not totally off regarding colors and if it gains a noticable advantage, I guess some cleanup work in the repository would make sense.
If Polymost still requires them, maybe it could at least make sense to remove the extra pals from the Polymer dirs (and defs) and move them to Polymost subdirs/defs instead, for easier "isolation" in case you want to have a Polymer-only pack.
(Since I don't know how far this feature has progressed since its introduction and considering no one has tried to do this step until now, I hope that no one minds my minor bump of this thread.)
The highpal feature (not supported by Polymost) still needs quite some adjustment. Using red and yellow keycards looks pretty bad for example. Therefore the removal of remaining alt-pals from the Polymer DEFs should be done carefully.


Given the size of recent model and texture additions the relative size of the Polymost overhead gets more and more negligible. You can create a Polymer (or Polymost) only HRP hierarchy any time by running ./installer/hrp_extract.sh, so the "isolation" is not that important.
FYI : current sizes (unzipped):
Full HRP : 769MiB
Polymer HRP : 681 MiB
Polymost HRP : 384 MiB
shared contents : 315MiB
Polymost overhead : 68MiB (<9%)
Polymer 'overhead' : 366MiB