asumagic / kag-staging

Issue tracker for the KAG staging build
6 stars 0 forks source link

Pixels under 128(0.5) transparency aren't culled/removed #125

Open Pirate-Rob opened 3 years ago

Pirate-Rob commented 3 years ago

In regular kag, images drawn with sprites have transparent pixels under a certain threshold have those pixels become fully transparent. Above a certain threshold they become opaque if I recall correctly. Human_Male This sort of sprite has 4 transparent pixels that are used as markers to attach limbs, however in game these marker pixels become visible:

asumagic commented 2 years ago

The issue is that following the render2d changes (understand: the internal name for a new unified and batched renderer in staging) the default RenderStyle now performs alpha blending.
... Because in vanilla for sprites it's "good enough" to not care too much about ordering when dealing with this blend mode, it indeed looks like the pixels are being blended against a black background (because they are).

There is an internal render2d blend mode that behaves the same as the vanilla KAG renderer, but it is currently not exposed.
The better option would be to make the default render style the same as before and instead expose a new RenderStyle that performs alpha blending, then change some scripts to use it (OTOH: speech bubbles).