Plagman, on Jan 12 2011, 08:04 PM, said:
TM: Right now we need to improve the generation scripts to end up with a set of maps. Lezing's approach yields very accurate results without having to finetune everything for each palette, but there are some problems. For example the nightvision pal is going to look way off if it only converts part of the space. We'd need an approach where the generation script is smart enough to extrapolate the regions of the base pal to cover all of RGB instead to get that right. Once we have a set of highpal maps, you just add them to the HRP and you're pretty much done, there's no work to be done for individual textures or models.
Extrapolation is what I was thinking about too. I've made some progress with my script today, now I can release it. The algorithm is mostly empirical though, so it performs a large amount of operations and works quite slow.
http://lzg.duke4.net/clutstat.zip
This archive contains both the Evaldraw script and a set of palettes for it (##0-25 are standard Duke pals and the rest is ExtCLUT pals). You might want to test it with some HRP textures. If it succeeds, I'll write a page with detailed info for my site.
A few recommendations regarding color map generation:
The script has an option to process a limited range of palette colors. The last line (with 15 self-luminous colors and the transparent color) doesn't fit into the model, so it's disabled by default. The palette may contain ambiguous colors which can interfere with each other. For example, if you process a pal which changes only blue shades, you're advised to disable the line of violets as well (set the range to 0-223).
Default sampling level is 64, what stands for 6-bit precision. To attain 7-bit precision, raise it to 128 (it will take 8x more time to generate). To save a TGA image containing a highpalookup, hit spacebar to enter output mode and then save your image via F6.
The keyboard commands are:
Enter: rebuild the map;
Space: toggle output mode;
R: reload test image;
-, =: set upper bound of the color range;
[, ]: set lower bound of the color range;
Down, Up: set sampling level;
Left, Right: change active look-up palette ID.