Page 1 of 1

[1.0.24] PNG Skin Error

Posted: Tue Aug 07, 2007 15:58
by Aabra
Skins that use .bmp files display without a problem, as you can see here:

Image


However, if you convert the files to .png then for some reason there is a strange aqua colour that appears all over the skin. It's relatively mild in this screenshot from behind but it can be much worse depending on the skin.

Image

For test wads go here:

http://download.yousendit.com/7A9F6312323BC9CB

janine.wad uses .bmp

janinepng.wad uses .png

This problem only occurs in opengl mode. There is no problem in software.

Posted: Wed Aug 08, 2007 8:51
by Graf Zahl
Color translations don't work for PNG graphics as in software mode. This is a technical limitation.

If you want to use PNGs for skins they must have the exact same palette as Doom uses. This means that color 247 must be black, not cyan as is the case here.

Posted: Thu Aug 09, 2007 18:11
by Aabra
Oh, I'm a bit confused though as this problem only occurs with skins. I converted many sprites and textures from BMP to .PNG and they're working beautifully.

In case you're wondering the reason why I'm interested in this - it's because I'd like the skins to display properly when playing both Heretic and Doom. All the other graphics (CTF Flags, Skulls, etc) BMP files get all messed up because of the palette, but PNG displays perfectly. (Execpt of course for skins)

If PNG doesn't work, what other possible solution to this problem could there be?

Posted: Thu Aug 09, 2007 21:14
by Graf Zahl
Skins are subject to translations. For that to work the palette has to be precisely the same as the PLAYPAL. In PLAYPAL color 247 is black but in your graphics it is cyan. That means that the translation tables don't work properly.

ZDoom does contain code to map between Heretic and Doom skins so if the skin is properly flagged it should work with both games (but obviously not with Hexen or Strife.) But since I never tested this code I don't know what it does precisely.

Posted: Sun Aug 12, 2007 21:15
by Aabra
Hrmm, that's interesting. By flagged do you mean using the skininfo lump? Setting game=heretic definitely does something to the skin... I need to experiment with this.

edit:

Ok, after some experimentation I managed to get the skin to work in Heretic. With the PNG version, I gave flag "game = heretic" in the skininfo lump. The skin then displayed in heretic without any problem. No cyan or anything.

In doom however, it was a complete mess. :( Also, when I removed the game = heretic flag, and replaced it with game = doom (or nothing at all) the skin displayed the same cyan colour error in doom.

Using the .bmp version however was a complete disaster. Setting game = heretic on the .bmp version of the skin destroyed the skin in both doom *and* heretic.

Posted: Mon Aug 13, 2007 9:16
by Graf Zahl
You have to get the cyan out of the palette. In the base palette it's black and everything that is supposed to be black gets translated to color 247. As I said: For translations to work with PNGs all 256 colors have to be the same as in the base palette. Currently there is only 255 matching colors. You really should stick to Doom patch format for skins.

Posted: Sun Aug 26, 2007 9:25
by Aabra
Torr brought up some interesting information regarding this problem today that he recommended I add to this report.


<Torr_Samaho> The important thing missing in your bug report is the fact that the PNG sprite properly translates to every color except black.
<Aabra> what do you mean
<Aabra> like the colours on the skin?
<Aabra> when you select the colour? or what
<Torr_Samaho> Yes
<Aabra> I didn't realize that was relevant.
<Torr_Samaho> If you select green, red or blue for example the png sprite looks perfect.
<Aabra> well - I didn't know
<Aabra> that black didn't look correct either
<Aabra> :P
<Aabra> what colour does it come out as?
<Torr_Samaho> I think cyan and black are switched.
<Aabra> hrmm
<Torr_Samaho> The cyan is appearing at places in the sprite that are originally green.
<Torr_Samaho> I came to this conclusion when trying to make the doomguy model sprite translate properly.


Hopefully this can help you Graf.

Posted: Sun Aug 26, 2007 17:45
by Graf Zahl
How often do I have to repeat that the problem is the cyan color in your pictures? Doom's palette doesn't have cyan at index 247 but black. If you want to do PNG skins, index 247 *must* be black or it won't work. Sorry, this is something I won't change. Translations for sprites that don't match the exact Doom palette are not supported.

Posted: Sun Aug 26, 2007 22:30
by Enjay
The Doom palette:

Image

See, no cyan at 247 - or anywhere for that matter.

Posted: Mon Aug 27, 2007 4:25
by TheDarkArchon
What did you use to export them: I know XWE changes 247 to cyan when exporting.