Custom decals: semi-transparency not working

Moderator: GZDoom Developers

Post Reply
Guest

Custom decals: semi-transparency not working

Post by Guest »

I have been trying to make custom decals and have replaced the 'CHIP' and ' BSPLAT's but I cannot get them to be displayed properly in the game. I know how it should work in theory but it doesn't work in practice. I have tried several way to improve it but the results are completely confusing and make no sense.

My latest attempt can be found in this testwad.
Can anyone please have look and tell me what is wrong an how to fix it.

Currently the decals are displayed in the game in only 2 colors.
For the bullet CHIPs the black is displayed as black, while it should be transparent
and the white looks transparent while it should be black. Furthermore there is no 'in between'; pixels are either black or transparent, but never semi-transparent.
The same goes for the blood splatters (only with the color red instead of black).
One funny thing with the blood splatters is that they are displayed in red (wrong pixels though) in my project, but black when used with the original zdoom. Perhaps because my project uses a different palette?


Saving them with different image programs doesn't work. Running the pictures from a zip instead of a wad doesn't work. Inverting the palette doesn't work.

I asked Enjay for help and he is just as confused as I am.
He e-mailed me:
The graphics seem to work in GZdoom.
The graphics show the problems that you detailed in ZDoom.
Nothing that I did with different palette values, bits per pixel values etc fixed the problem.
Saving them as TGAs did not solve the problem.
Saving them as paletted PNGs with built in transparency made them look a bit better but they broke in GZdoom.
Saving them as Doom format graphics did seem to resolve a lot of the problems but they would need a lot of "cleanup" to be perfect as there were quite a few stray pixels - probably more down to my method of doing it rather than anything else.
Has anyone ever made custom decals with semi-transparency that worked? If so how?

thanks
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Custom decals: semi-transparency not working

Post by Graf Zahl »

The software renderer requires that such graphics need to be marked with an alPh chunk. That can be done with the setpng tool.

GZDoom doesn't use this chunk at all and treats alpha shaded graphics just as a different colormap so it's working there (but as you noticed this method can't handle images with per-pixel translucency.)

Maybe the software renderer should consider a different method here that doesn't require specific modification of the image.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Custom decals: semi-transparency not working

Post by Xaser »

I remember having some trouble with something like this a while back, and questioned exactly why the software renderer required the use of the alPh chunk. Randy had a bit more to say about it here, and as far as I can tell, perhaps the same applies here?
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Custom decals: semi-transparency not working

Post by randi »

If the PNG spec would allow for images with an alpha channel but no color information, I would just use that. But since it doesn't, I had to create the alPh chunk to flag grayscale images as alpha channels that shouldn't be remapped to the palette.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Custom decals: semi-transparency not working

Post by Graf Zahl »

I know. What I meant was to make the decision what type of texture to create depend on the situation.

All situations in which alpha shaded textures are used are flagged by the renderstyle flag STYLEF_RedIsAlpha. That is the only information I use in GZDoom to create an alpha shaded texture and the alPh chunk is simply ignored. Of course this would mean some changes to the way software renderer textures are created because the texture can exist in 2 states (normal and shaded.)

I'm just thinking that this report is ample proof that the alPh chunk is not a user friendly method when they want to do their own decal textures.
Guest

Re: Custom decals: semi-transparency not working

Post by Guest »

In 1957, decals are all rainbow-y. :(

- Nash
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Custom decals: semi-transparency not working

Post by TheDarkArchon »

Ursula Pittgold wrote:In 1957, decals are all rainbow-y. :(

- Nash
I believe colour film was starting to get popular around that time, rainbow colour everything was in at that time. (cue rimshot)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Custom decals: semi-transparency not working

Post by Graf Zahl »

I think this is better placed in Feature Suggestions rather than bugs. After all, this works as intended, it's just that this is a sub-optimal solution...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Custom decals: semi-transparency not working

Post by Graf Zahl »

Another one that should be done properly after QZDoom gets merged back.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”