Page 1 of 1

Translucency for black background tracers?

Posted: Sun Oct 20, 2019 7:25 pm
by Graaicko
So I'm adding sprite based tracers to the weapons. Was wondering how to make sprites with black backgrounds translucent, specifically for projectiles. Recolored some tracers from Brutal doom to match real life 5.56x45 tracer ammunition. They light up red just like these.
Spoiler:

Re: Translucency for black background tracers?

Posted: Sun Oct 20, 2019 8:54 pm
by Cherno
Silly question, but why do these sprites have a black background when it's supposed to be translucent :?:

Re: Translucency for black background tracers?

Posted: Sun Oct 20, 2019 10:08 pm
by Graaicko
Its a png file. I believe if you set some command, it makes the sprite translucent, and you don't even see the background, this is what I'm looking for.

Re: Translucency for black background tracers?

Posted: Sun Oct 20, 2019 10:20 pm
by Cherno
Use RenderStyle Add for the actor.

Code: Select all

Renderstyle ADD
Alpha 1.0//or whatever

Re: Translucency for black background tracers?

Posted: Mon Oct 21, 2019 3:31 am
by Enjay
Worth pointing out that, using this method, if you have a powerup that inverts the palette (the invulnerability power up or the enhanced night vision), all the black areas will become visible as white. So all of your projectiles will be surrounded by white rectangles. It's much better to edit the sprites to make them have proper translucency and transparency. I would still use additive rendering on them though because that looks best for effects like this.

Re: Translucency for black background tracers?

Posted: Mon Oct 21, 2019 7:58 am
by Void Weaver
Yep, Slade basic sprite editor can remove sprite's background colour by selected range if choosed option "Transparent Colour:", but it can remain a some black border around sprite in case if it have internal translucensy. So in that case is better solution is use Gimp\PShop to remove background\borders colour by alpha channel.

But in current case Cherno advice is quite good, I guess.

Re: Translucency for black background tracers?

Posted: Mon Oct 21, 2019 8:08 am
by Enjay
Personally, I use Paint Shop Pro's ability to create a "mask" that uses the luminance of each pixel to set its translucency. Fully black = fully translucent. It sometimes requires a bit of secondary editing because the entire thing can end up too translucent at the first pass. I just paste subsequents layer of the same masked sprite on top of each other to build up opacity until I'm satisfied with the look (quick and easy to do, usually just pressing Ctrl-L 3 or 4 times). The black background never reappears because it is fully transparent now, but the edges of the projectile sometimes end up a bit darker than perhaps I'd want. However, it's not visible most of the time and even with a palette inverting powerup active, it still looks much better than a black rectangle. Anyway, then I save and stick the graphic into my WAD/PK3 and that's it.

Obviously, I still need to set up the actor how I want in DECORATE/ZScript, but at least the background translucency is taken care of.

Here's one that worked out quite well:

Image

Image