Automatic alpha-map decals from grayscale images

Moderator: GZDoom Developers

Post Reply
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Automatic alpha-map decals from grayscale images

Post by Risen »

Nash wrote:I wish ZDoom's code would be changed so that it simply treats a grayscale graphic as an alpha decal (and if the DECALDEF for it has the "color" property set).
Seconded.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

First, how does ZDoom know that you're using a grayscale graphic? If it was to literally check the index number of the color against the known original palette, that would break the moment someone uses a custom palette.

How does the color property help clarify this? The wiki's entry on it is... less than helpful.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

HotWax wrote:First, how does ZDoom know that you're using a grayscale graphic?
Read the appropriate PNG chunk, of course. IIRC, A palette isn't stored with grayscale images at all.
Spoiler: more info on that
HotWax wrote:How does the color property help clarify this?
The 'color' property defines what color the decal should be drawn in. An alpha-map must have a color defined, so leaving that property blank could default to drawing the decal as a grayscale image, in case that may have been the intended effect.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

That would mean second-guessing an image's contents. That's why the setpng tool can be used to tag the images as alpha maps. I'm sorry but this shouldn't be done automatically.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

It's too bad the PNG specification does not have an official way to store an alpha channel without a color channel. Graf is right. There are perfectly valid reasons to store an image as grayscale, and the engine should not assume it's something else.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

How about a new "alphamap" keyword for DECALDEF?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”