Need help with SetPNG and true colour alpha PNGs

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Need help with SetPNG and true colour alpha PNGs

Post by Nash »

I have a Doom 2 logo replacement (replaces M_DOOM).

The original graphic is a true colour PNG. Why true colour? Because I need the transparency information for a smooth gradient fade out effect that my graphic uses. If I convert the PNG to 8-bit, Photoshop discards the transparency.

Anyway, all works well but then comes the problem of setting the offset.

I know how to use SetPNG to set offset for PNGs, but for some reason SetPNG refuses to work for my graphic. I did a test and converted it to 8-bit (and lost the transparency) and suddenly SetPNG works (successfully saves the offsets). Tried it again with true colour and it doesn't work.

I'm stumped. Are there any workarounds?
User avatar
Shinjanji
Posts: 198
Joined: Sun Nov 06, 2005 16:45
Location: Pennsylvania, USA

Post by Shinjanji »

hmm... IIRC, PNG files have various bits of extra header information in them. SetPNG probably writes information into these headers that ZDoom/GZDoom looks for. If you found out what it wrote (you could find out with a test graphic or look through the source code) then you might be able to manually add the information to your PNG.

Though well-knowing of the limits of my ability to troubleshoot, there is either a much easier solution, or I have all of my information totally wrong. TRY IT AT YOUR OWN RISK! XD
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

8 bit formats fully support translucency. I think it's time to look for better tools. Photoshop is utter crap when it comes to PNG support. Google for PNGQUANT. It is a small command line tool that should help you convert your picture to 8 bit while retaining the alpha channel.

But since you are replacing an original patch your best way of action is to use the 'remap' function of HIRESTEX. At this moment GZDoom does not read offset information from hires PNGs.
DaniJ
Posts: 130
Joined: Sat Oct 08, 2005 19:22

Post by DaniJ »

Graf Zahl wrote:8 bit formats fully support translucency. I think it's time to look for better tools. Photoshop is utter crap when it comes to PNG support.
Your clearly using it incorrectly if thats what you think ;)
At this moment GZDoom does not read offset information from hires PNGs.
Nor should it IMO.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

DaniJ wrote:Nor should it IMO.
Why not?
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Graf: Do model skins support alpha channel translucency?

PNGs with one transparent colour works (holes will appear on the model) but I can't seem to create smooth gradient skins that fade out.

Or is it another "Photoshop is crap" issue?
DaniJ
Posts: 130
Joined: Sat Oct 08, 2005 19:22

Post by DaniJ »

Enjay wrote:
DaniJ wrote:Nor should it IMO.
Why not?
IMO that offset info is NOT metadata, as such it doesn't belong in the resources.
PNGs with one transparent colour works (holes will appear on the model) but I can't seem to create smooth gradient skins that fade out.

Or is it another "Photoshop is crap" issue?
At a guess I would say this is due to GZDoom converting the PNGs to the DOOM palette. Please don't blame Photoshop as it certainly does handle this very well indeed. The problem with PNG is that there isn't a seperate alpha channel (as there is in TGA for example), this means that alpha must be applied to the base layer in a "destructive manner".

The way to best use Photoshop when alpha is required is use the native PSD format as your "master", with a "layer mask" for your alpha channel. When you save as PNG Photoshop will convert the alpha channel down to the base layer as required for PNG.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Nash wrote:Graf: Do model skins support alpha channel translucency?
You will get weird results. Translucent polygons have to be sorted and with models this will cause problems. Right now I am forcing all models to be rendered completely opaque.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Any plans for alpha skins to be supported for models?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

No. As I said, the polygons need to be sorted and with models that have a lot of them it can become very tricky. And model explosions aren't worth the effort IMO. For that sprites look better.
DaniJ
Posts: 130
Joined: Sat Oct 08, 2005 19:22

Post by DaniJ »

And model explosions aren't worth the effort IMO
True but these arn't nearly the only reason to sort model polys.

Most models use alpha to create details that can't be modelled due to the massive number of extra polys it would require.

For example monsters, might be modelled so that hair is made up of several layers of alpha'd polygons. Other examples would be a Wizards' tattered robes or the 3D spinning plasma shots, muzzle flashes etc etc in the jDRP 1.1 alpha.

Not supporting texture alpha for models severely limits what the artist can create.

However if you can't sort them in GZDoom at present, Graf is right to force model textures to be opaque, as the results would look awful otherwise.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

EDIT: PNGQUANT works like a charm. :D The picture appears screwed in Photoshop but looks good in GZDoom.

Thanks Graf!

Regarding no alpha skin model support: oh well. Looks like I can't create smooth hair textures then.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Nash wrote:The picture appears screwed in Photoshop.

As I said: Crap PNG support! :P
DaniJ
Posts: 130
Joined: Sat Oct 08, 2005 19:22

Post by DaniJ »

The picture appears screwed in Photoshop.
Why are you working in PNG anyway!? Use PSD for everything and only convert to PNG when you HAVE to (getting it in the game).
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Dani, any person in their rightful mind wouldn't work with PNG alone.

I never work without keeping the PSD master (or source as I like to call them) files.

But I just wanted to preview my image that was ran through pngquant to see if the transparency information is kept and was surprised to see a bunch of red mess.

It displays fine in GZDoom, so (unfortunately) I'm gonna have to agree on Graf with this one (despite me being a Photoshop fanboy) - PS is crap at that area!

Don't get me wrong though, I still love PS. PS 4eVa :rock:
Locked

Return to “GZDoom”