[Done] Custom decals: semi-transparency not working

Moderator: Developers

Custom decals: semi-transparency not working

Postby Fanny Gubberkatch » Mon Oct 19, 2009 3:35 pm

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
Fanny Gubberkatch
 

Re: Custom decals: semi-transparency not working

Postby Graf Zahl » Mon Oct 19, 2009 3:45 pm

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Custom decals: semi-transparency not working

Postby Xaser » Mon Oct 19, 2009 10:28 pm

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
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: Custom decals: semi-transparency not working

Postby randi » Tue Oct 20, 2009 12:04 pm

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
randi
Site Admin
 
Joined: 09 Jul 2003

Re: Custom decals: semi-transparency not working

Postby Graf Zahl » Tue Oct 20, 2009 12:35 pm

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Custom decals: semi-transparency not working

Postby Ursula Pittgold » Sun Nov 01, 2009 8:04 am

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

- Nash
Ursula Pittgold
 

Re: Custom decals: semi-transparency not working

Postby TheDarkArchon » Mon Nov 02, 2009 9:13 pm

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
TheDarkArchon
OUT!
 
Joined: 07 Aug 2004
Location: Some cold place

Re: Custom decals: semi-transparency not working

Postby Graf Zahl » Thu Dec 17, 2009 6:17 pm

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 Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Custom decals: semi-transparency not working

Postby Graf Zahl » Sat Feb 25, 2017 1:01 pm

Another one that should be done properly after QZDoom gets merged back.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests