Colors and Palettes?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Colors and Palettes?

Post by NeuralStunner »

I have several questions regarding colors in ZDoom, all numbered for your (in?)convenience.

1. I wold like to be able to make a custom palette for a wad. How would I convert an 8-bit (256 color) indexed palette into a PLAYPAL lump? (It would be a PSP 7 format palette, or I could even use a standard bitmap.)
2. Adding a different PLAYPAL into a PWad does override the IWad default, correct? (Pretty sure it does, but just makin' sure.)
3. If so, would full color PNGs be forced to the new palette (in ZDoom), rather than the IWad it "rides" on?
4. XWE does not seem to import PNGs as sprites without forcing color conversion. Is SlumpEd better about this, or am I stuck with format limitations, and thus using PK3 Sprite directories?
5. Any possibility that ZDoom will have full color options at any point?

At present I cannot use any of the GZDoom SVNs until the renderer overhaul is finished (and hopefully I will be able to after that). BSOD... :(

Much appreciated.
User avatar
Zhs2
Posts: 1300
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: Colors and Palettes?

Post by Zhs2 »

1. It has to be in the .act file format, I believe (if that's just an 8-bit indexed palette, then, yeah, you're totally on the right path, but, alas, I do not know myself. Peas.) Try exporting the palette you've created in PSP 7 and just rename it to PLAYPAL.lmp. If nothing else, though, you can make an image of said palette and use BHS's Palette Dump tool to convert it to a usable palette file (which happens to use the same format .act files do...)
2. Yes.
3. Yes.
4. SLumpEd behaves much better about PNG inclusion than XWE.
5. IIRC, that's an unavoidable limitation of said renderer. I forget exactly why. :(
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Colors and Palettes?

Post by NeuralStunner »

Thanks a ton, that helps immensely. :thumb:

Edit:

I almost forgot! I know how to set a translation range for a custom player class (actor), however where would I change the translations for player numbers? (I.E. Hexen 1=Blue, 2=Red, 3=Yellow, 4=Green) Is it hard-coded?
User avatar
Sussudio
Posts: 16
Joined: Sun Sep 06, 2009 2:46 pm

Re: Colors and Palettes?

Post by Sussudio »

NeuralStunner wrote:1. I wold like to be able to make a custom palette for a wad. How would I convert an 8-bit (256 color) indexed palette into a PLAYPAL lump? (It would be a PSP 7 format palette, or I could even use a standard bitmap.)
http://thegate.gamers.org/pub/idgames2/ ... cx2pal.zip

This program will generate Doom-compatible palettes from paletted pcx's, but keep in mind palettes must be colour-indexed specifically for Doom, you just can't extract a palette from some random PCX image and put it in a wad file, it would look like garbage.
User avatar
Zhs2
Posts: 1300
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: Colors and Palettes?

Post by Zhs2 »

NeuralStunner wrote:I almost forgot! I know how to set a translation range for a custom player class (actor), however where would I change the translations for player numbers? (I.E. Hexen 1=Blue, 2=Red, 3=Yellow, 4=Green) Is it hard-coded?
Most likely. The wiki doesn't turn up anything helpful on that subject, although I suppose it's a bit redundant with ZDoom's color-per-player system...
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Colors and Palettes?

Post by NeuralStunner »

Hmm, yes, that's true.

Oddly enough, custom translations "buck the system" as far as the palette goes... I set all my player colors to teal blue, and it shows fine despite not being in the PLAYPAL. (Thus the thought "does ZDoom have to be paletted?) :?
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: Colors and Palettes?

Post by phi108 »

You have to import raw data into XWE to make sure PNGs aren't converted.

And I usually just throw PNGs into the /sprites or /patches directories of a zip/pk3. If your mod is a zip file, this is a simple method. But then you have to set sprite offsets by exporting the sprites from a WAD or using TEXTURES or something else.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Colors and Palettes?

Post by Project Shadowcat »

NeuralStunner wrote:Hmm, yes, that's true.

Oddly enough, custom translations "buck the system" as far as the palette goes... I set all my player colors to teal blue, and it shows fine despite not being in the PLAYPAL. (Thus the thought "does ZDoom have to be paletted?) :?
That's because the example you showed is not part of the renderer. 2-D elements that aren't involved with the 3-D space (by default) avoid this restriction. Randy's tinkering with Direct3D allows this so that the crosshairs can be any color, HUD elements can be anything, etc. but anything in the 3-D space has to go to the color palette.

So that teal marine is going to look like a wash of blue and green in-game.

ED: Note that this is from a player stand-point: I'm open to any correction or clarification on the matter.
Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: Colors and Palettes?

Post by Gez »

Zhs2 wrote:5. IIRC, that's an unavoidable limitation of said renderer. I forget exactly why. :(
Not exactly unavoidable. It's just that it would require a lot of work. I know that at least one Boom feature (full TRANMAP tweaking) has been rejected because it would lock the renderer forever in 8-bit color mode, and that justification would not be used if the code was already locked by something else. The mere fact that Randy said he never implemented that for this reason shows that there is a possibility, in the post-Doomscript future ( :P ), for an update of the software renderer to be thought about.

Also, DelphiDoom supports 32-bit color and uses the software renderer. Sure, it's not in C anymore since it was ported to Delphi, but I think the core algorithms are the same.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: Colors and Palettes?

Post by Zippy »

Project Dark Fox wrote:That's because the example you showed is not part of the renderer. 2-D elements that aren't involved with the 3-D space (by default) avoid this restriction. Randy's tinkering with Direct3D allows this so that the crosshairs can be any color, HUD elements can be anything, etc. but anything in the 3-D space has to go to the color palette.

So that teal marine is going to look like a wash of blue and green in-game.

ED: Note that this is from a player stand-point: I'm open to any correction or clarification on the matter.
You basically got it. All the 2D elements of the screen: status bars, hud messages, menus, etc., can be full color. Anything rendered into the world will be converted to the game palette.
Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: Colors and Palettes?

Post by Gez »

I think that weapon HUD sprites, though, are still subjected to the palette.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Colors and Palettes?

Post by randi »

Yes, but I'd like to fix that.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Colors and Palettes?

Post by Xaser »

While I'm thinking about it and since it's somewhat on-topic, there's something that's been bugging me for a while that I want to ask about: It seems that true-color PNGs when used as fonts (defined in FONTDEFS, for instance) are still auto-converted to the palette even when untranslated. Is this changeable in any way or form, or is it simply a restriction caused by the way the fonts work?

Best example I can think of is the HUD in Zero Tolerance. The weapon-stats display at the top is a 16-bit PNG defined as a font and, as you can see, the cyan ranges don't show up right.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Colors and Palettes?

Post by randi »

That's the way fonts work in order to allow for recoloring. Your best option would be to use an image editor to reduce the image's palette to 256 colors and then convert that to a font with imagetool. Proper fonts can retain their palette, but images that are converted to fonts in-game will be restricted to the game palette.
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: Colors and Palettes?

Post by phi108 »

randy wrote:Yes, but I'd like to fix that.
That is the sexiest sentence I have ever read. (I hope the poor Doom palette doesn't take offence, after all these years, I just want to move on. It's not me, it's it.)
Locked

Return to “Editing (Archive)”