Automatic alpha-map decals from grayscale images

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Automatic alpha-map decals from grayscale images

by Risen » Mon Oct 15, 2007 4:29 pm

How about a new "alphamap" keyword for DECALDEF?

by randi » Mon Oct 15, 2007 3:58 pm

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.

by Graf Zahl » Mon Oct 15, 2007 2:15 pm

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.

by Risen » Mon Oct 15, 2007 1:43 pm

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.

by HotWax » Mon Oct 15, 2007 12:02 pm

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.

Automatic alpha-map decals from grayscale images

by Risen » Mon Oct 15, 2007 11:44 am

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.

Top