Black + Additive =/= Transparent

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Black + Additive =/= Transparent

Post by Tormentor667 »

I noticed this already several times and I think this can be considered as a bug, even though I do not know how the software renderer actually handles things.

If you have a black texture and apply the TranslucentLine special to a 2-sided wall using that black texture, additive translucency should actually make the black parts completely invisible. Though for some reason they "darken" what's behind them (about 5-10%).

Here is a little example:
Image

These "steam" sprites consist of white circles on a totally black background. For some reason you can actually see this black background.
User avatar
esselfortium
Posts: 3862
Joined: Tue Sep 19, 2006 8:43 pm
Contact:

Re: Black + Additive =/= Transparent

Post by esselfortium »

If I remember right, this has been reported before and is a known precision issue. It'd be much slower to do it "right". The solution is to just use actual transparency to replace the offending dark colors in your additive sprites/textures.
Blzut3
 
 
Posts: 3215
Joined: Wed Nov 24, 2004 12:59 pm
Operating System Version (Optional): Kubuntu
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Black + Additive =/= Transparent

Post by Blzut3 »

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

Re: Black + Additive =/= Transparent

Post by Graf Zahl »

Never *EVER* use black for transparency in additive sprites. It doesn't work right. Cheat yourself some invulnerability and watch the wonderful rectangles around the smoke!
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Black + Additive =/= Transparent

Post by Tormentor667 »

I could also use alpha channels but the problem is that this doesn't work fine when I want to use translations as well. If I want to have a sfx in 5 different colors, I do need 5 different sets of sprites :(
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Black + Additive =/= Transparent

Post by Graf Zahl »

If you want to use translations you have to use Doom patch format. If you use that you already got your transparent color, so where's the problem?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Black + Additive =/= Transparent

Post by Xaser »

The problem is that it doesn't happen to just black (#000000), but to any other color that's sufficiently dark enough. That means that in order to work around this, a couple more shades of dark have to be removed (resulting in a not-quite-smooth fade to translucent in GL).

Not that it's a huge deal, mind you, but that just goes to say that this still happens in cases where transparency is correctly applied to the outside sprite edges.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Black + Additive =/= Transparent

Post by Tormentor667 »

That's exactly the problem that I run into in the above screenshot.
Post Reply

Return to “Closed Bugs [GZDoom]”